json-parse-helpfulerror

WebJar for json-parse-helpfulerror

License

License

MIT
Categories

Categories

JSON Data
GroupId

GroupId

org.webjars.npm
ArtifactId

ArtifactId

json-parse-helpfulerror
Last Version

Last Version

1.0.3
Release Date

Release Date

Type

Type

jar
Description

Description

json-parse-helpfulerror
WebJar for json-parse-helpfulerror
Project URL

Project URL

https://www.webjars.org
Source Code Management

Source Code Management

https://github.com/smikes/json-parse-helpfulerror

Download json-parse-helpfulerror

How to add to project

<!-- https://jarcasting.com/artifacts/org.webjars.npm/json-parse-helpfulerror/ -->
<dependency>
    <groupId>org.webjars.npm</groupId>
    <artifactId>json-parse-helpfulerror</artifactId>
    <version>1.0.3</version>
</dependency>
// https://jarcasting.com/artifacts/org.webjars.npm/json-parse-helpfulerror/
implementation 'org.webjars.npm:json-parse-helpfulerror:1.0.3'
// https://jarcasting.com/artifacts/org.webjars.npm/json-parse-helpfulerror/
implementation ("org.webjars.npm:json-parse-helpfulerror:1.0.3")
'org.webjars.npm:json-parse-helpfulerror:jar:1.0.3'
<dependency org="org.webjars.npm" name="json-parse-helpfulerror" rev="1.0.3">
  <artifact name="json-parse-helpfulerror" type="jar" />
</dependency>
@Grapes(
@Grab(group='org.webjars.npm', module='json-parse-helpfulerror', version='1.0.3')
)
libraryDependencies += "org.webjars.npm" % "json-parse-helpfulerror" % "1.0.3"
[org.webjars.npm/json-parse-helpfulerror "1.0.3"]

Dependencies

compile (1)

Group / Artifact Type Version
org.webjars.npm : jju jar [1.1.0,2)

Project Modules

There are no modules declared in this project.

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

Versions

Version
1.0.3
1.0.2
1.0.1