Created
August 5, 2016 19:39
-
-
Save morganherlocker/ab9deec2734d252395cb7134f693bdba 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 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