File tree Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Expand file tree Collapse file tree 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()`][].
369369added: v8.0.0
370370-->
371371
372- * ` error ` {Error}
372+ * ` error ` {Error} Optional, an error to emit with ` 'error' ` event.
373373* Returns: {this}
374374
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.
376377After this call, the writable stream has ended and subsequent calls
377378to ` 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.
378383Implementors should not override this method,
379384but instead implement [ ` writable._destroy() ` ] [ writable-_destroy ] .
380385
You can’t perform that action at this time.
0 commit comments