Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
var through2 = require('through2')
var fs = require('fs')
var byline = require('byline')
var combine = through2(function(chunk, enc, next){
console.log(chunk.toString())
console.log('--')
next()
})
fs.readdir('./data', function(err, files){
files.forEach(function(file){
fs.createReadStream('./data/' + file)
.pipe(byline.createStream())
.pipe(combine)
})
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment