wallet-core/node_modules/load-json-file
2018-09-20 02:56:13 +02:00
..
index.js update packages 2018-09-20 02:56:13 +02:00
license add node_modules to address #4364 2016-10-10 03:43:44 +02:00
package.json update packages 2018-09-20 02:56:13 +02:00
readme.md update packages 2018-09-20 02:56:13 +02:00

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