file_write.js 329 Bytes Raw Blame History Permalink 1 2 3 4 5 6 7 8 9 10 11 12 13 var fs = require('fs'); fs.readFile('getids.js', 'utf-8', function(error, data) { console.log('01 readAsync: %s',data); if(error){ try{ fs.writeFileSync('file02_sync.txt', "hello", 'utf-8'); console.log('02 WRITE DONE!'); }catch(e){ console.log(e); } } });