Socket
Socket
Sign inDemoInstall

streamsink

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

streamsink - npm Package Compare versions

Comparing version 1.0.1 to 1.1.0

LICENSE

6

index.js

@@ -10,2 +10,3 @@ var stream = require('stream');

this.buffer = [];
this.length = 0;
}

@@ -15,2 +16,3 @@

this.buffer.push(chunk);
this.length += chunk.length;
callback();

@@ -34,1 +36,5 @@ };

};
StreamSink.prototype.toBuffer = function() {
return Buffer.concat(this.buffer, this.length);
};

2

package.json
{
"name": "streamsink",
"version": "1.0.1",
"version": "1.1.0",
"description": "pipe to a buffer, then create readable streams from it",

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

@@ -0,1 +1,5 @@

# node-streamsink
See also [bl](https://github.com/rvagg/bl).
## Usage

@@ -12,3 +16,9 @@

sink.createReadStream().pipe(someDestination);
// or use toString([encoding])
console.log(sink.toString('utf8'));
// or use toBuffer()
sink.toBuffer();
});
```

@@ -10,2 +10,6 @@ var StreamSink = require('./');

assert.strictEqual(newSink.toString(), "hi");
var buf = sink.toBuffer();
assert.strictEqual(buf.length, 2);
assert.strictEqual(buf[0], 104);
assert.strictEqual(buf[1], 105);
console.log("OK");

@@ -12,0 +16,0 @@ });

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