1
0
mirror of https://github.com/actions/setup-python synced 2024-11-30 21:22:28 +08:00
setup-python/node_modules/load-json-file/readme.md
Danny McCormick 39c08a0eaa Initial pass
2019-06-26 21:12:00 -04:00

939 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 for the parsed JSON.

loadJsonFile.sync(filepath)

Returns the parsed JSON.

License

MIT © Sindre Sorhus