Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

drop-stream

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

drop-stream

A Duplex stream which discards all chunks passed through

  • 0.1.0
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

drop-stream Dependencies Status Image Build Status Image Coverage Status

A Duplex stream which discards all chunks passed through.

Usage

Install using:

npm install drop-stream --save

Then pipe through a drop instance:

var DropStream = require('drop-stream'),
    PassThrough = require('stream').PassThrough,
    opts = {objectMode: true},
    pre = new PassThrough(opts),
    drop = DropStream.obj(),
    post = new PassThrough(opts),
    count = 0;

post.on('data', function() {
  count++;
});

post.on('data', function() {
  count++;
});

post.on('finish', function() {
  assert.strictEqual(count, 0, count + ' chunks detected'); // won't throw
});

pre.pipe(drop).pipe(post);

pre.write('foo');
pre.write(1);
pre.write({ foobar: 'foobar', answer: 42 });
pre.write('bar');
pre.end();

API

Class: DropStream

Drop streams are Transform streams.

new DropStream([options])

Note: The new operator can be omitted

DropStream#obj([options])

A convenience wrapper for new DropStream({objectMode: true, ...}).

License

Copyright (c) 2014 Michael Mayer

Licensed under the MIT license.

Keywords

FAQs

Package last updated on 05 Jul 2014

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