Skip to content

tleen/json-decompact

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

Javascript utility to take a compacted JSON string and prettify it

Resources

License

Stars

Watchers

Forks

Packages

No packages published