>npm init
//write-file.js const fs = require('fs'), path = 'out/output.txt', content = 'line 1\nline 2', prn = (o) => console.log(o.toString()); const callbackFct = (err) => { if (err) throw err; prn('File written successfully'); } fs.writeFile(path, content, callbackFct);
>node write-file