Comparing version 2.4.0 to 2.5.0
@@ -323,6 +323,12 @@ 'use strict' | ||
this.on('end', () => resolve(buf)) | ||
this.on('error', reject) | ||
this.on('error', er => reject(er)) | ||
}) | ||
} | ||
// const data = await stream.concat() | ||
concat () { | ||
return this.collect().then(chunks => | ||
this[ENCODING] ? chunks.join('') : Buffer.concat(chunks)) | ||
} | ||
// for await (let chunk of stream) | ||
@@ -329,0 +335,0 @@ [ASYNCITERATOR] () { |
{ | ||
"name": "minipass", | ||
"version": "2.4.0", | ||
"version": "2.5.0", | ||
"description": "minimal implementation of a PassThrough stream", | ||
@@ -12,3 +12,3 @@ "main": "index.js", | ||
"end-of-stream": "^1.4.0", | ||
"tap": "^12.0.1", | ||
"tap": "^14.6.1", | ||
"through2": "^2.0.3" | ||
@@ -20,3 +20,3 @@ }, | ||
"postversion": "npm publish", | ||
"postpublish": "git push origin --all; git push origin --tags" | ||
"postpublish": "git push origin --follow-tags" | ||
}, | ||
@@ -23,0 +23,0 @@ "repository": { |
@@ -60,2 +60,15 @@ # minipass | ||
### collecting into a single blob | ||
This is a bit slower because it concatenates the data into one chunk for | ||
you, but if you're going to do it yourself anyway, it's convenient this | ||
way: | ||
```js | ||
mp.concat().then(onebigchunk => { | ||
// onebigchunk is a string if the stream | ||
// had an encoding set, or a buffer otherwise. | ||
}) | ||
``` | ||
### iteration | ||
@@ -62,0 +75,0 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
14886
330
138