json-decompact

1.0.0 • Public • Published

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
}
*/

Package Sidebar

Install

npm i json-decompact

Weekly Downloads

0

Version

1.0.0

License

MIT

Last publish

Collaborators

  • tleen