Skip to content

Instantly share code, notes, and snippets.

@goodbabies
Created May 13, 2016 22:04
Show Gist options
  • Save goodbabies/2f3a6556a409ee6739fbf8a7e6925ab7 to your computer and use it in GitHub Desktop.
Save goodbabies/2f3a6556a409ee6739fbf8a7e6925ab7 to your computer and use it in GitHub Desktop.
var fs = require('fs');
var data = {
hoge: 100,
foo: 'a',
bar: true,
};
fs.writeFile('./files/test.json', JSON.stringify(data, null, ' '), function (err) {
if (err) throw err;
console.log('It\'s saved!');
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment