summaryrefslogtreecommitdiffstats
path: root/node_modules/minipass-flush/README.md
diff options
context:
space:
mode:
authorGravatar Piotr Russ <mail@pruss.it> 2020-11-18 23:26:45 +0100
committerGravatar Piotr Russ <mail@pruss.it> 2020-11-18 23:26:45 +0100
commit81ddf9b700bc48a1f8e472209f080f9c1d9a9b09 (patch)
tree8b959d50c5a614cbf9fcb346ed556140374d4b6d /node_modules/minipass-flush/README.md
parent1870f3fdf43707a15fda0f609a021f516f45eb63 (diff)
downloadwebsite_creator-81ddf9b700bc48a1f8e472209f080f9c1d9a9b09.tar.gz
website_creator-81ddf9b700bc48a1f8e472209f080f9c1d9a9b09.tar.bz2
website_creator-81ddf9b700bc48a1f8e472209f080f9c1d9a9b09.zip
rm node_modules
Diffstat (limited to 'node_modules/minipass-flush/README.md')
-rw-r--r--node_modules/minipass-flush/README.md47
1 files changed, 0 insertions, 47 deletions
diff --git a/node_modules/minipass-flush/README.md b/node_modules/minipass-flush/README.md
deleted file mode 100644
index 7eea400..0000000
--- a/node_modules/minipass-flush/README.md
+++ /dev/null
@@ -1,47 +0,0 @@
-# minipass-flush
-
-A Minipass stream that calls a flush function before emitting 'end'
-
-## USAGE
-
-```js
-const Flush = require('minipass-flush')
-cons f = new Flush({
- flush (cb) {
- // call the cb when done, or return a promise
- // the 'end' event will wait for it, along with
- // close, finish, and prefinish.
- // call the cb with an error, or return a rejecting
- // promise to emit 'error' instead of doing the 'end'
- return rerouteAllEncryptions().then(() => clearAllChannels())
- },
- // all other minipass options accepted as well
-})
-
-someDataSource.pipe(f).on('end', () => {
- // proper flushing has been accomplished
-})
-
-// Or as a subclass implementing a 'flush' method:
-class MyFlush extends Flush {
- flush (cb) {
- // old fashioned callback style!
- rerouteAllEncryptions(er => {
- if (er)
- return cb(er)
- clearAllChannels(er => {
- if (er)
- cb(er)
- cb()
- })
- })
- }
-}
-```
-
-That's about it.
-
-If your `flush` method doesn't have to do anything asynchronous, then it's
-better to call the callback right away in this tick, rather than returning
-`Promise.resolve()`, so that the `end` event can happen as soon as
-possible.