]> gerrit.simantics Code Review - simantics/district.git/blob - org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/read-package-json/node_modules/json-parse-helpfulerror/README.md
Adding integrated tile server
[simantics/district.git] / org.simantics.maps.server / node / node-v4.8.0-win-x64 / node_modules / npm / node_modules / read-package-json / node_modules / json-parse-helpfulerror / README.md
1 # json-parse-helpfulerror
2
3 A drop-in replacement for `JSON.parse` that uses
4 <https://npmjs.org/jju> to provide more useful error messages in the
5 event of a parse error.
6
7 # Example
8
9 ## Installation
10
11 ```
12 npm i -S json-parse-helpfulerror
13 ```
14
15 ## Use
16
17 ```js
18 var jph = require('json-parse-helpfulerror');
19
20 var notJSON = "{'foo': 3}";     // keys must be double-quoted in JSON
21
22 JSON.parse(notJSON);            // throws unhelpful error
23
24 jph.parse("{'foo': 3}")         // throws more helpful error: "Unexpected token '\''..."
25 ```
26
27 # License
28
29 MIT