Skip to content

Instantly share code, notes, and snippets.

@ali-arslan

ali-arslan/works and doesnt Secret

Last active Sep 9, 2015
Embed
What would you like to do?
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