Adicionar bandeira Persmison para escrever nodejs de arquivo
var fs = require('fs');
var stream = fs.createWriteStream('hello.js', { mode: 0o755 });
stream.write("#!/usr/bin/node\n");
stream.write("console.log('hello world');");
stream.end();
Restu Wahyu Saputra