Last active
January 31, 2016 15:10
-
-
Save lleo/9928733 to your computer and use it in GitHub Desktop.
Revisions
-
lleo revised this gist
Apr 2, 2014 . 1 changed file with 2 additions and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -3,7 +3,8 @@ var fs = require('fs') , thunkify = require('thunkify') , co = require('co') , readFile = thunkify(fs.readFile) , fns = ["file0.txt", "file1.txt" , "file2.txt", "file3.txt"] co(function*(){ var contents = '', i -
lleo revised this gist
Apr 2, 2014 . 1 changed file with 2 additions and 2 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,8 +1,8 @@ #!/usr/bin/env node --harmony-generators var fs = require('fs') , thunkify = require('thunkify') , co = require('co') , readFile = thunkify(fs.readFile) , fns = ["file0.txt", "file1.txt", "file2.txt", "file3.txt"] co(function*(){ -
lleo renamed this gist
Apr 2, 2014 . 1 changed file with 0 additions and 0 deletions.There are no files selected for viewing
File renamed without changes. -
lleo revised this gist
Apr 2, 2014 . 1 changed file with 0 additions and 14 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,14 +0,0 @@ -
lleo created this gist
Apr 2, 2014 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,14 @@ #!/usr/bin/env node --harmony-generators var fs = require('fs') , thunk = require('thunkify') , co = require('co') , readFile = thunk(fs.readFile) , fns = ["file0.txt", "file1.txt", "file2.txt", "file3.txt"] co(function*(){ var contents = '', i for (i=0; i<fns.length; i+=1) { contents += yield readFile(fns[i]) } console.log(contents) })() This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,14 @@ #!/usr/bin/env node --harmony-generators var fs = require('fs') , thunk = require('thunkify') , co = require('co') , readFile = thunk(fs.readFile) , fns = ["file0.txt", "file1.txt", "file2.txt", "file3.txt"] co(function*(){ var contents, thunks thunks = fns.map(function(fn){ return readFile(fn) }) contents = (yield thunks).join('') console.log(contents) })()