@@ -17,9 +17,6 @@ from this stream via `'data'` events or by calling `pipe()` into some other
17
17
stream. Calling ` read() ` requires the buffer to be flattened in some
18
18
cases, which requires copying memory.
19
19
20
- There is also no ` unpipe() ` method. Once you start piping, there is no
21
- stopping it!
22
-
23
20
If you set ` objectMode: true ` in the options, then whatever is written will
24
21
be emitted. Otherwise, it'll do a minimal amount of Buffer copying to
25
22
ensure proper Streams semantics when ` read(n) ` is called.
@@ -383,6 +380,10 @@ mp.end('bar')
383
380
by default if you write() something other than a string or Buffer at any
384
381
point. Setting ` objectMode: true ` will prevent setting any encoding
385
382
value.
383
+ * ` async ` Defaults to ` false ` . Set to ` true ` to defer data
384
+ emission until next tick. This reduces performance slightly,
385
+ but makes Minipass streams use timing behavior closer to Node
386
+ core streams. See [ Timing] ( #timing ) for more details.
386
387
387
388
### API
388
389
@@ -404,9 +405,12 @@ streams.
404
405
from being emitted for empty streams until the stream is resumed.
405
406
* ` resume() ` - Resume the stream. If there's data in the buffer, it is all
406
407
discarded. Any buffered events are immediately emitted.
407
- * ` pipe(dest) ` - Send all output to the stream provided. There is no way
408
- to unpipe. When data is emitted, it is immediately written to any and
409
- all pipe destinations.
408
+ * ` pipe(dest) ` - Send all output to the stream provided. When
409
+ data is emitted, it is immediately written to any and all pipe
410
+ destinations. (Or written on next tick in ` async ` mode.)
411
+ * ` unpipe(dest) ` - Stop piping to the destination stream. This
412
+ is immediate, meaning that any asynchronously queued data will
413
+ _ not_ make it to the destination when running in ` async ` mode.
410
414
* ` on(ev, fn) ` , ` emit(ev, fn) ` - Minipass streams are EventEmitters. Some
411
415
events are given special treatment, however. (See below under "events".)
412
416
* ` promise() ` - Returns a Promise that resolves when the stream emits
0 commit comments