admin_vue/11-前端模块化开发Webpack(Node.js基础)/04-webpack_Loader使用/node_modules/load-json-file
3056762376@qq.com 37ffd941b0 changes 2022-11-20 18:09:09 +08:00
..
index.js changes 2022-11-20 18:09:09 +08:00
license changes 2022-11-20 18:09:09 +08:00
package.json changes 2022-11-20 18:09:09 +08:00
readme.md changes 2022-11-20 18:09:09 +08:00

readme.md

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