* @param {string} filePath * @returns {Promise } - parsed JSON content of the file
(filePath)
| 6 | * @returns {Promise<Object>} - parsed JSON content of the file |
| 7 | */ |
| 8 | async function parseJsonFile(filePath) { |
| 9 | const contentStr = await fs.promises.readFile(filePath, { encoding: 'utf-8' }); |
| 10 | // We use parse-json instead of JSON.parse because it throws errors with better explanations what is wrong |
| 11 | return parse(contentStr, filePath); |
| 12 | } |
| 13 | export { parseJsonFile }; |
| 14 | export { recursiveReadDir }; |
| 15 | export default { |
no test coverage detected