Socket
Socket
Sign inDemoInstall

load-json-file

Package Overview
Dependencies
9
Maintainers
1
Versions
15
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    load-json-file

Read and parse a JSON file


Version published
Weekly downloads
16M
decreased by-11.74%
Maintainers
1
Install size
111 kB
Created
Weekly downloads
 

Readme

Source

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.

  • write-json-file - Stringify and write JSON to a file atomically

License

MIT © Sindre Sorhus

Keywords

FAQs

Last updated on 14 Nov 2015

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc