Guest User

Reading a 2GB text file with nodejs

a guest
Aug 7th, 2016
614
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. var fs = require('fs');
  2.  
  3. var readable = fs.createReadStream(__dirname + '/dailydump.txt', {
  4.     encoding: 'utf8',
  5.     highWaterMark : 20 * 1024 * 1024
  6. });
  7.  
  8. readable.on('data', function (chunk){
  9.     console.log(chunk);
  10. });
Advertisement
Add Comment
Please, Sign In to add comment