Big update!Introducing GitHub Bot Commands. Learn more
Socket
Log inDemoInstall

json-parse-better-errors

Package Overview
Dependencies
0
Maintainers
1
Versions
3
Issues
File Explorer

Advanced tools

json-parse-better-errors

JSON.parse with context information on error

    1.0.2latest
    Github

Version published
Maintainers
1
Weekly downloads
17,955,082
increased by7.08%

Weekly downloads

Changelog

Source

1.0.2 (2018-03-30)

Bug Fixes

  • messages: More friendly messages for non-string (#1) (a476d42)

<a name="1.0.1"></a>

Readme

Source

json-parse-better-errors npm version license Travis AppVeyor Coverage Status

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.

Install

$ npm install --save json-parse-better-errors

Table of Contents

Example

const parseJson = require('json-parse-better-errors') parseJson('"foo"') parseJson('garbage') // more useful error message

Features

  • Like JSON.parse, but the errors are better.

Contributing

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!

API

> parse(txt, ?reviver, ?context=20)

Works just like JSON.parse, but will include a bit more information when an error happens.

Keywords

FAQs

What is json-parse-better-errors?

JSON.parse with context information on error

Is json-parse-better-errors popular?

The npm package json-parse-better-errors receives a total of 17,160,427 weekly downloads. As such, json-parse-better-errors popularity was classified as popular.

Is json-parse-better-errors well maintained?

We found that json-parse-better-errors demonstrated a not healthy version release cadence and project activity because the last version was released a year ago.It has 1 open source maintainer collaborating on the project.

Last updated on 30 Mar 2018

Did you know?

Socket installs a Github app to automatically flag issues on every pull request and report the health of your dependencies. Find out what is inside your node modules and prevent malicious activity before you update the dependencies.

Install Socket
Socket[email protected]

Product

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc