1.0.2 • Published 12 years ago
catstream v1.0.2
node-catstream
Filenames go in, contents come out. You can't explain that.
Installation
npm install --save catstreamUsage
catstream is a Transform stream that takes filenames as inputs and outputs the contents of said filenames in the order they were read.
var filenames = [
'a.txt', // content: hello
'b.txt', // content: goodbye
'c.txt' // content: o rly
];
var cat = require('catstream');
var c = cat()
cat.pipe(process.stdout)
cat.end(filenames.join('\n'))
// prints "hello goodbye o rly" to the consolemore usually you have a readable stream with a list of filenames that you pipe to this.
Reference
new CatStream(transformer, options)
Creates a new cat stream.
transformeris a function that returns a transform stream. Each time a new file is read and whentransformeris defined, the content of the file is piped through the transform stream.optionsa configuration object for the transform stream. The default options for transform streams are applicable and the following is added:separatorthe separator between filenames in the input. defaults to newline.
License
the MIT License. Look it up.
