file_write.js 329 Bytes
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);
        }
    }
});