-
-
Save ali-arslan/a5e4a3e66ceb29c7d0b1 to your computer and use it in GitHub Desktop.
This file contains 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 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