MCPcopy Create free account
hub / github.com/bigcommerce/stencil-cli / parseJsonFile

Function parseJsonFile

lib/utils/fsUtils.js:8–12  ·  view source on GitHub ↗

* @param {string} filePath * @returns {Promise } - parsed JSON content of the file

(filePath)

Source from the content-addressed store, hash-verified

6 * @returns {Promise<Object>} - parsed JSON content of the file
7 */
8async 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}
13export { parseJsonFile };
14export { recursiveReadDir };
15export default {

Callers 7

getSchemaMethod · 0.90
getSchemaTranslationsMethod · 0.90
getRawConfigMethod · 0.90
getRawSchemaMethod · 0.90

Calls 1

parseFunction · 0.90

Tested by

no test coverage detected