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

stream-exhaust

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

stream-exhaust - npm Package Compare versions

Comparing version 1.0.0 to 1.0.1

12

index.js
var Writable = require('stream').Writable;
var inherits = require('util').inherits;
module.exports = resumer
module.exports = resumer;

@@ -11,4 +11,12 @@ function resumer(stream) {

stream._read ? stream.pipe(new Sink) : stream.resume();
if (stream._read) {
stream.pipe(new Sink);
return stream;
}
if (typeof stream.resume === 'function') {
stream.resume();
return stream;
}
return stream;

@@ -15,0 +23,0 @@ }

2

package.json
{
"name": "stream-exhaust",
"version": "1.0.0",
"version": "1.0.1",
"description": "Ensure that a stream is flowing data without mutating it",

@@ -5,0 +5,0 @@ "main": "index.js",

@@ -6,3 +6,3 @@ # stream-exhaust

``javascript
```javascript
var exhaustively = require('stream-exhaust');

@@ -12,5 +12,4 @@

.on('close', () => { console.log('all done, despite being streams{1+N}!') });
```
``
## Prior Art

@@ -17,0 +16,0 @@

@@ -188,2 +188,23 @@ var test = require('tape');

assert.end();
})
});
test('does not error on no resume but readable set to true', function(assert) {
var rs = new Stream();
rs.readable = true;
var ended = false;
var i;
rs.on("end", function() {
assert.ok(ended, 'ended is true');
assert.end();
});
exhaust(rs);
for (i = 0; i < 100; i++) {
rs.emit("data", i);
}
ended = true;
rs.emit("end");
});
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