Newer
Older
CVSS_3.0_GUI / dist / CVSS_3.0_Calc-1.0.0-linux-x64 / node_modules / nwjs-builder-phoenix / node_modules / yargs / node_modules / read-pkg-up / node_modules / read-pkg / node_modules / load-json-file / readme.md
root on 7 May 2019 951 bytes Initial commit

load-json-file Build Status

Read and parse a JSON file

Strips UTF-8 BOM, uses graceful-fs, and throws more helpful JSON errors.

Install

$ npm install --save load-json-file

Usage

const loadJsonFile = require('load-json-file');

loadJsonFile('foo.json').then(json => {
    console.log(json);
    //=> {foo: true}
});

API

loadJsonFile(filepath)

Returns a promise that resolves to the parsed JSON.

loadJsonFile.sync(filepath)

Returns the parsed JSON.

License

MIT © Sindre Sorhus