Skip to content

Latest commit

 

History

History
executable file
·
29 lines (19 loc) · 584 Bytes

README.md

File metadata and controls

executable file
·
29 lines (19 loc) · 584 Bytes

Simple remake of JSON.parse/.stringify that supports non-standard JSON parsing

Parses not-JSON like:

{ a: 1, b: "2", c: '3', "d": [1, "2", '3'] }

Installation:

$ npm i not-json

Usage:

var notJSON = require('not-json')

var obj = notJSON.parse('{ a: 1, b: "2", c: \'3\', "d": [1, "2", \'3\'] }')

console.log(obj)
// { a: 1, b: '2', c: '3', d: [ 1, '2', '3' ] }

var json = notJSON.stringify(obj)

console.log(json)
// {"a":1,"b":"2","c":"3","d":[1,"2","3"]}