This repository has been archived on 2024-07-27. You can view files and clone it, but cannot push or open issues or pull requests.
keksAccountGUI/node_modulesOLD/load-json-file/readme.md
2019-08-11 20:48:02 +02:00

951 B

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