$ npm install format-package-jsonModule attempts to detect the spacing used, the final line ending.
It will then attempt to reformat an Object back into this string and save the file.
var format = require('format-package-json')
format('/path/to/package.json', function (err, data) {
//data - the string that it wrote
//That's it
})
format.syncformat.readSyncformat.writeSync