This is a
playground to test code. It runs a full
Node.js environment and already has all of
npm’s 400,000 packages pre-installed, including
file-appender with all
npm packages installed. Try it out:
This service is provided by RunKit and is not affiliated with npm, Inc or the package authors.
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
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