json-parse-better-errors
Advanced tools
JSON.parse with context information on error
Weekly downloads
Changelog
Readme
json-parse-better-errors
is a Node.js library for
getting nicer errors out of JSON.parse()
, including context and position of the parse errors.
$ npm install --save json-parse-better-errors
const parseJson = require('json-parse-better-errors')
parseJson('"foo"')
parseJson('garbage') // more useful error message
The npm team enthusiastically welcomes contributions and project participation! There's a bunch of things you can do if you want to contribute! The Contributor Guide has all the information you need for everything from reporting bugs to contributing entire new features. Please don't hesitate to jump in if you'd like to, or even ask us questions if something isn't clear.
All participants and maintainers in this project are expected to follow Code of Conduct, and just generally be excellent to each other.
Please refer to the Changelog for project history details, too.
Happy hacking!
> parse(txt, ?reviver, ?context=20)
Works just like JSON.parse
, but will include a bit more information when an
error happens.
JSON.parse with context information on error
The npm package json-parse-better-errors receives a total of 14,180,774 weekly downloads. As such, json-parse-better-errors popularity was classified as popular.
We found that json-parse-better-errors demonstrated a not healthy version release cadence and project activity. It has 1 open source maintainer collaborating on the project.