Name: liquid-json
Owner: Postman
Description: Implementation of JSON that ignores BOM and thows friendly error
Created: 2016-08-24 19:28:37.0
Updated: 2018-05-22 18:37:02.0
Pushed: 2018-05-22 18:37:03.0
Homepage: null
Size: 172
Language: JavaScript
GitHub Committers
User | Most Recent Commit | # Commits |
---|
Other Committers
User | Most Recent Commit | # Commits |
---|
Implementation of JSON
which ignores BOM and shows more detailed error messages on parse failures.
m install liquid-json --save;
avascript
LJSON = require('liquid-json');
N.parse('{ "hello": "world" }');
N.stringify({ hello: 'world' });
LJSON.parse
accepts reviver
function as second parameter and LJSON.stringify
accepts standard JSON parameters.
All errors raised from this module has error name as JSONError
.
LJSON = require('liquid-json').async;
N.parse('{ "hello": "world" }', function (err, obj) {
console.log(obj); // logs the object
N.stringify({ hello: 'world' }, function (err, text) {
console.log(text); // logs '{"hello":"world"}'