Create a gist now

Instantly share code, notes, and snippets.

Empty file written - demo code
var fs = require('fs');
var file_tree = ['test1.txt', 'test2.txt'];
var data = ['d1', 'd2'];
for(i in file_tree) {
fp = fs.createWriteStream(file_tree[i]);
for(i in data) {
fp.write(data[i]+'\n', function (err) { if(err) throw err;});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment