Guardar archivo con nodejs

var fs = require('fs');

fs.writeFile('message.txt', 'Hello Node.js', (err) => {
if (err) throw err;
console.log('The file has been saved!');
});