Socket
Socket
Sign inDemoInstall

json-parse-helpfulerror

Package Overview
Dependencies
1
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

json-parse-helpfulerror

A drop-in replacement for JSON.parse that uses `jju` to give helpful errors


Version published
Maintainers
1
Weekly downloads
924,174
decreased by-18.34%
Install size
75.5 kB

Weekly downloads

Readme

Source

json-parse-helpfulerror

A drop-in replacement for JSON.parse that uses https://npmjs.org/jju to provide more useful error messages in the event of a parse error.

Example

Installation

npm i -S json-parse-helpfulerror

Use

var jph = require('json-parse-helpfulerror');

var notJSON = "{'foo': 3}";     // keys must be double-quoted in JSON

JSON.parse(notJSON);            // throws unhelpful error

jph.parse("{'foo': 3}")         // throws more helpful error: "Unexpected token '\''..."

License

MIT

Keywords

FAQs

Last updated on 04 Jan 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