const fs = require('fs')
const content = 'Some content!'
try {
fs.writeFileSync('/Users/joe/test.txt', content)
//file written successfully
} catch (err) {
console.error(err)
}
const fs = require('fs');
fs.writeFileSync( '/myData.json', JSON.stringify(myData) );