Socket
Socket
Sign inDemoInstall

minipass-collect

Package Overview
Dependencies
2
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 1.0.1 to 1.0.2

11

package.json
{
"name": "minipass-collect",
"version": "1.0.1",
"version": "1.0.2",
"description": "A Minipass stream that collects all the data into a single chunk",

@@ -18,10 +18,13 @@ "author": "Isaac Z. Schlueter <i@izs.me> (https://izs.me)",

"devDependencies": {
"tap": "^14.6.4"
"tap": "^14.6.9"
},
"dependencies": {
"minipass": "^2.5.1"
"minipass": "^3.0.0"
},
"files": [
"index.js"
]
],
"engines": {
"node": ">= 8"
}
}

@@ -8,2 +8,7 @@ # minipass-collect

Note: this is primarily useful for the `Collect.PassThrough` class, since
Minipass streams already have a `.collect()` method which returns a promise
that resolves to the array of chunks, and a `.concat()` method that returns
the data concatenated into a single Buffer or String.
## USAGE

@@ -19,7 +24,14 @@

someSourceOfData.pipe(colllector)
someSourceOfData.pipe(collector)
// note that you can also simply do:
someSourceOfData.pipe(new Minipass()).concat().then(data => ...)
// or even, if someSourceOfData is a Minipass:
someSourceOfData.concat().then(data => ...)
// but you might prefer to have it stream-shaped rather than
// Promise-shaped in some scenarios.
```
If you want to collect the data, but also act as a passthrough stream, then
use `Collect.PassThrough` instead (for example to memoize streaming
If you want to collect the data, but _also_ act as a passthrough stream,
then use `Collect.PassThrough` instead (for example to memoize streaming
responses), and listen on the `collect` event.

@@ -35,5 +47,5 @@

someSourceOfData.pipe(colllector).pipe(someOtherStream)
someSourceOfData.pipe(collector).pipe(someOtherStream)
```
All [minipass options](http://npm.im/minipass) are supported.
SocketSocket SOC 2 Logo

Product

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc