node package manager
Share your code. npm Orgs help your team discover, share, and reuse code. Create a free org »



travis build codecov coverage version downloads MIT License semantic-release

Pipe a list of files to a transform stream.

Sometimes you have a lot of files, and want to pipe them all to a writable stream. Instead of writing code, having to care about edge cases and everything, just use file-appender.


npm install file-appender


Pipe a list of files to an output file:

var appender = require('file-appender');
var output = require('fs').createWriteStream('./output.txt');
appender(['./foo.txt', './bar.txt']).pipe(output);

It also works if you pass a path to a directory, like:


It won't check if the files in the respective directory are text files, or even another directory. In this case, make sure it contains just the files you want to pipe.

It doesn't make much sense to do this, but it still work if you pass just a string with the path to a single file:



Licensed under the MIT license