Skip to content

Instantly share code, notes, and snippets.

@morganherlocker
Created August 5, 2016 19: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 morganherlocker/ab9deec2734d252395cb7134f693bdba to your computer and use it in GitHub Desktop.
Save morganherlocker/ab9deec2734d252395cb7134f693bdba to your computer and use it in GitHub Desktop.
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