Skip to content

A simple synchronous JSON-with-comments loader that gives good explanations of where failures come from

Notifications You must be signed in to change notification settings

krakenjs/load-jsonic-sync

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

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.

About

A simple synchronous JSON-with-comments loader that gives good explanations of where failures come from

Resources

Stars

Watchers

Forks

Packages