|
2 rokov pred | |
---|---|---|
.. | ||
index.d.ts | 2 rokov pred | |
index.js | 2 rokov pred | |
license | 2 rokov pred | |
package.json | 2 rokov pred | |
readme.md | 2 rokov pred |
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.