1.0.0 • Published 10 years ago

json-decompact v1.0.0

Weekly downloads
1
License
MIT
Repository
github
Last release
10 years ago

json-decompact

Javascript utility to take a compacted JSON string and prettify it

Just One Thing

The module is the function, take a compacted json string, return it pretty printed:

var obj = {astring : "This is a string", anum : 5, aflt : 5.5};
var compactJSON = JSON.stringify(obj);
console.log(compactJSON);
// {"astring":"This is a string","anum":5,"aflt":5.5}

var decompact = require('json-decompact');

console.log(decompact(compactJSON));
/*
{
 "astring": "This is a string",
 "anum": 5,
 "aflt": 5.5
}
*/