Created
June 15, 2014 19:02
-
-
Save retrohacker/66310a03132d0733ea98 to your computer and use it in GitHub Desktop.
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 characters
| var wait = require('waitgroup') | |
| var fs = require('fs') | |
| var wg = new wait | |
| var list = ['file1.txt','file2.txt','file3.txt','file4.txt'] | |
| list.forEach(function(val) { | |
| wg.add() | |
| fs.readFile(val,{"encoding":"UTF-8"},function(e,data) { | |
| if(e) console.log(e) | |
| else console.log(data) | |
| wg.done() | |
| }) | |
| }) | |
| wg.wait(function() { | |
| console.log("All Open!") | |
| }) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment