|
il y a 2 ans | |
---|---|---|
.. | ||
index.d.ts | il y a 2 ans | |
index.js | il y a 2 ans | |
license | il y a 2 ans | |
package.json | il y a 2 ans | |
readme.md | il y a 2 ans |
Read and parse a JSON file
Strips UTF-8 BOM, uses graceful-fs
, and throws more helpful JSON errors.
$ npm install load-json-file
const loadJsonFile = require('load-json-file');
(async () => {
console.log(await loadJsonFile('foo.json'));
//=> {foo: true}
})();
Returns a Promise<unknown>
with the parsed JSON.
Returns the parsed JSON.
Type: object
Type: Function
Applies a function to the JSON string before parsing.
Type: Function
Prescribes how the value originally produced by parsing is transformed, before being returned. See the JSON.parse
docs for more.