File tree 1 file changed +7
-2
lines changed
1 file changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -369,12 +369,17 @@ See also: [`writable.uncork()`][].
369
369
added: v8.0.0
370
370
-->
371
371
372
- * ` error ` {Error}
372
+ * ` error ` {Error} Optional, an error to emit with ` 'error' ` event.
373
373
* Returns: {this}
374
374
375
- Destroy the stream, and emit the passed ` 'error' ` and a ` 'close' ` event.
375
+ Destroy the stream. Optionally emit an ` 'error' ` event, and always emit
376
+ a ` 'close' ` event.
376
377
After this call, the writable stream has ended and subsequent calls
377
378
to ` write() ` or ` end() ` will result in an ` ERR_STREAM_DESTROYED ` error.
379
+ This is a destructive and immediate way to destroy a stream. Previous calls to
380
+ ` write() ` may not have drained, and may trigger an ` ERR_STREAM_DESTROYED ` error.
381
+ Use ` end() ` instead of destroy if data should flush before close, or wait for
382
+ the ` 'drain' ` event before destroying the stream.
378
383
Implementors should not override this method,
379
384
but instead implement [ ` writable._destroy() ` ] [ writable-_destroy ] .
380
385
You can’t perform that action at this time.
0 commit comments