1.0.0 • Published 8 years ago
@marcossffilho/noop-stream v1.0.0
Noop Stream
Streams that does nothing.
It's like a noop function, but for stream.
What is this?
If you want a default stream that does nothing, this is the place!
Let me give you an example:
const {Writable} = require('@marcossffilho/noop-stream')
// This is the Console API, provided by Node
const {Console} = require('console')
// Will be sent to STDERR if SHOW_OUTPUT is true, but will die in the void
// if not.
let debugConsole = new Console(SHOW_OUTPUT ? process.stderr : new Writable)
debugConsole.log("This is a log")
Usage
To install in your project:
npm install --save @marcossffilho/noop-stream
And you have access to:
require('@marcossffilho/noop-stream').Writable;
require('@marcossffilho/noop-stream').Readable;
// TODO:
// require('@marcossffilho/noop-stream').Duplex;
// require('@marcossffilho/noop-stream').Transform;
1.0.0
8 years ago