minipass-collect
Advanced tools
Comparing version 1.0.1 to 1.0.2
{ | ||
"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. |
4870
49
+ Addedminipass@3.3.6(transitive)
+ Addedyallist@4.0.0(transitive)
- Removedminipass@2.9.0(transitive)
- Removedsafe-buffer@5.2.1(transitive)
- Removedyallist@3.1.1(transitive)
Updatedminipass@^3.0.0