All Projects → sindresorhus → Noop Stream

sindresorhus / Noop Stream

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

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to Noop Stream

Into Stream
Convert a string/promise/array/iterable/asynciterable/buffer/typedarray/arraybuffer/object into a stream
Stars: ✭ 167 (+317.5%)
Mutual labels:  stream, npm-package
Stream Deck Api
API to interact with the Elgato Stream Deck controller
Stars: ✭ 36 (-10%)
Mutual labels:  stream
Sidecar
Some old C++ code I developed while at MIT. Could be useful if you have an old radar lying around.
Stars: ✭ 20 (-50%)
Mutual labels:  stream
Byte Size
Isomorphic function to convert a bytes value (e.g. 3456) to a human-readable string ('3.5 kB')
Stars: ✭ 33 (-17.5%)
Mutual labels:  npm-package
Soundwaveinteractive
Interactive Sound Board for Mixer. Microsoft shut Mixer down, so this application no longer works. RIP Mixer.
Stars: ✭ 27 (-32.5%)
Mutual labels:  stream
Dropbox Stream
Upload & Download streams for Dropbox
Stars: ✭ 35 (-12.5%)
Mutual labels:  stream
Python Stream
更优雅的流式数据处理方式
Stars: ✭ 20 (-50%)
Mutual labels:  stream
Reddit sse stream
A Server Side Event stream to deliver Reddit comments and submissions in near real-time to a client.
Stars: ✭ 39 (-2.5%)
Mutual labels:  stream
Purefun
Functional Programming library for Java
Stars: ✭ 37 (-7.5%)
Mutual labels:  stream
Zipstream Php
💾 PHP ZIP Streaming Library
Stars: ✭ 961 (+2302.5%)
Mutual labels:  stream
Express React Boilerplate
🚀🚀🚀 This is a tool that helps programmers create Express & React projects easily base on react-cool-starter.
Stars: ✭ 32 (-20%)
Mutual labels:  npm-package
Androidstreamable
Unofficial https://streamable.com API Wrapper for Android
Stars: ✭ 29 (-27.5%)
Mutual labels:  stream
Saber
Window-Based Hybrid CPU/GPU Stream Processing Engine
Stars: ✭ 35 (-12.5%)
Mutual labels:  stream
Catchart
Pipe something from command line to a chart in the browser
Stars: ✭ 27 (-32.5%)
Mutual labels:  npm-package
Labeled Stream Splicer
stream splicer with labels
Stars: ✭ 37 (-7.5%)
Mutual labels:  stream
Epoch Timeago
🕓 Convert unix time to a relative time string e.g., "4 hours ago".
Stars: ✭ 20 (-50%)
Mutual labels:  npm-package
Xtream Iptv Player Reactnative
Stars: ✭ 30 (-25%)
Mutual labels:  stream
Node Streamspeed
A simple way to keep track of the speed of your node streams.
Stars: ✭ 33 (-17.5%)
Mutual labels:  stream
Rivers
Data Stream Processing API for GO
Stars: ✭ 39 (-2.5%)
Mutual labels:  stream
Snappydata
Project SnappyData - memory optimized analytics database, based on Apache Spark™ and Apache Geode™. Stream, Transact, Analyze, Predict in one cluster
Stars: ✭ 995 (+2387.5%)
Mutual labels:  stream

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

const stream = require('stream');
const {readableNoopStream} = require('noop-stream');

stream.pipeline(readableNoopStream({size: 10}), process.stdout);
const stream = require('stream');
const {writableNoopStream} = require('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.

Related

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].