https://github.com/krakenjs/load-jsonic-sync
A simple synchronous JSON-with-comments loader that gives good explanations of where failures come from
https://github.com/krakenjs/load-jsonic-sync
Last synced: 4 months ago
JSON representation
A simple synchronous JSON-with-comments loader that gives good explanations of where failures come from
- Host: GitHub
- URL: https://github.com/krakenjs/load-jsonic-sync
- Owner: krakenjs
- Created: 2015-07-29T15:38:55.000Z (almost 10 years ago)
- Default Branch: master
- Last Pushed: 2015-07-29T17:08:49.000Z (almost 10 years ago)
- Last Synced: 2024-12-30T21:15:36.430Z (6 months ago)
- Language: JavaScript
- Size: 87.9 KB
- Stars: 0
- Watchers: 13
- Forks: 2
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
load-jsonic-sync
================A simple synchronous JSON-with-comments loader that gives good explanations of
where failures come from.It accepts a superset of JSON including Javscript style comments (`/* */` and
`//`).Use
----```javascript
var loadJsonicSync = require('load-jsonic-sync');var result = loadJsonicSync('file.json');
````loadJsonicSync` will throw an error if loading fails. The error will show the
filename, for context, and `error.cause()` will show the original exception
which includes the position for parse errors, and the underlying fs error if
there is a problem reading the file.