Created
February 24, 2013 17:38
-
-
Save charliegroll/5024740 to your computer and use it in GitHub Desktop.
For some reason, test is empty after this happens but isn't while it's being populated
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 test = []; | |
| var fs = require('fs'); | |
| var filename = '/usr/share/dict/words'; | |
| require('readline').createInterface({ | |
| input: fs.createReadStream(filename), | |
| terminal: false | |
| }).on('line', function(line){ | |
| test.push(line); | |
| }); | |
| console.log(test.length); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
(see comment on FB)