I'm a Full-Stack web developer
var obj = {
"foo": "bar"
}
// readable json file var json = JSON.stringify(messageJson, null, “\t”);
3. Save to file
var fs = require(‘fs’); fs.writeFile(‘jsonfile.json’, json, ‘utf8’, function(err) { if(err) { console.log(err) }else { console.log(“** File saved **”) } }); ```