postmanlabs/liquid-json

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

UserMost Recent Commit# Commits

Other Committers

UserEmailMost Recent Commit# Commits

README

liquid-json

Implementation of JSON which ignores BOM and shows more detailed error messages on parse failures.

usage
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.

asynchronous flavour
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"}'

attributions

This work is supported by the National Institutes of Health's National Center for Advancing Translational Sciences, Grant Number U24TR002306. This work is solely the responsibility of the creators and does not necessarily represent the official views of the National Institutes of Health.