Read and parse a JSON file
Strips UTF-8 BOM, uses graceful-fs
, and throws more helpful JSON errors.
$ npm install --save load-json-file
const loadJsonFile = require('load-json-file');
loadJsonFile('foo.json').then(json => {
console.log(json);
//=> {foo: true}
});
Returns a promise for the parsed JSON.
Returns the parsed JSON.
- write-json-file - Stringify and write JSON to a file atomically
MIT © Sindre Sorhus