# json-parse-helpfulerror

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

Latest version **1.0.3** (published 2015-01-04) · MIT license · 0 weekly downloads

## Install

```sh
npm install json-parse-helpfulerror
pnpm add json-parse-helpfulerror
yarn add json-parse-helpfulerror
bun add json-parse-helpfulerror
```

## Health

**Score 23/100 (F)** — status: abandoned.

Positive: has types package; no vulnerabilities; high quality score.

Warnings: low downloads; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.3 |
| Published | 2015-01-04 |
| First published | 2015-01-04 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | separate (@types/json-parse-helpfulerror) |
| Module format | CommonJS |
| Dependencies | 1 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 19 |
| Author | Sam Mikes |
| Maintainers | smikes |
| Keywords | json, parse, line, doublequote, error |

## Links

- npm: https://www.npmjs.com/package/json-parse-helpfulerror
- Repository: https://github.com/smikes/json-parse-helpfulerror
- Issues: https://github.com/smikes/json-parse-helpfulerror/issues
- npm.io page: https://npm.io/package/json-parse-helpfulerror

## Dependencies (1)

- [jju](https://npm.io/package/jju.md) ^1.1.0

## Alternatives

- [@mapbox/jsonlint-lines-primitives](https://npm.io/package/@mapbox/jsonlint-lines-primitives.md) — 5.3M weekly downloads
- [reftools](https://npm.io/package/reftools.md) — 3.5M weekly downloads
- [@hey-api/openapi-ts](https://npm.io/package/@hey-api/openapi-ts.md) — 3.5M weekly downloads
- [@mapbox/geojson-rewind](https://npm.io/package/@mapbox/geojson-rewind.md) — 2.4M weekly downloads
- [turbo-stream](https://npm.io/package/turbo-stream.md) — 1.7M weekly downloads

## Recent versions

- 1.0.3 (latest) — 2015-01-04
- 1.0.2 — 2015-01-04
- 1.0.1 — 2015-01-04

## README

# 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

```js
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

---
_Source: https://npm.io/package/json-parse-helpfulerror · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
