Skip to content

Instantly share code, notes, and snippets.

@ali-arslan
Last active September 9, 2015 18:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ali-arslan/a5e4a3e66ceb29c7d0b1 to your computer and use it in GitHub Desktop.
Save ali-arslan/a5e4a3e66ceb29c7d0b1 to your computer and use it in GitHub Desktop.
var fs = require('fs') // WORKS! Outputs file line by line.
var liner = require('./liner')
var source = fs.createReadStream('./hhh.in')
source.pipe(liner)
// var testcases, matrix_size
liner.on('readable', function () {
var line;
// var testcases = liner.read();
console.log(liner.read());
while (line = liner.read()) {
console.log(line);
}
})
var fs = require('fs') // Doesn't work. The act of storing in var destroys everything?
var liner = require('./liner')
var source = fs.createReadStream('./hhh.in')
source.pipe(liner)
// var testcases, matrix_size
liner.on('readable', function () {
var line;
var testcases = liner.read();
// console.log(liner.read());
while (line = liner.read()) {
console.log(line);
}
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment