@marcossffilho/noop-stream

Streams that does nothing


Keywords
stream, writable
License
MIT
Install
npm install @marcossffilho/noop-stream@1.0.0

Documentation

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;