Socket
Socket
Sign inDemoInstall

noop-stream

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

noop-stream

Create a readable Node.js stream that produces no data (or optionally blank data) or a writable stream that discards data


Version published
Weekly downloads
2K
decreased by-16.61%
Maintainers
1
Weekly downloads
 
Created
Source

noop-stream

Create a readable Node.js stream that produces no data (or optionally blank data) or a writable stream that discards data

This can be useful for testing, fixtures, draining a stream, etc. (Example)

It's like fs.createReadStream('/dev/null') but cross-platform.

Install

npm install noop-stream

Usage

import stream from 'stream';
import {readableNoopStream} from 'noop-stream';

stream.pipeline(readableNoopStream({size: 10}), process.stdout);
import stream from 'stream';
import {writableNoopStream} from 'noop-stream';

stream.pipeline(process.stdin, writableNoopStream());

API

readableNoopStream(options?)

Create a readable Node.js stream that produces no data (or optionally blank data).

Options are passed to the stream.Readable constructor, except for the read option.

You can also specify a size option, which is the size in bytes to produce. By default, it's 0. Set it to Infinity to make it produce data until you manually destroy the stream.

writableNoopStream(options?)

Create a writable Node.js stream that discards received data.

Options are passed to the stream.Writable constructor, except for the write option.

Keywords

FAQs

Package last updated on 14 Oct 2021

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc