Skip to main content
Deno 2 is finally here 🎉️
Learn more
Module

std/node/stream.ts>Readable#destroy

Deno standard library
Go to Latest
The Standard Library has been moved to JSR. See the blog post for details.
method Readable.prototype.destroy
Re-export
import { Readable } from "https://deno.land/std@0.170.0/node/stream.ts";

Destroy the stream. Optionally emit an 'error' event, and emit a 'close'event (unless emitClose is set to false). After this call, the readable stream will release any internal resources and subsequent calls to push()will be ignored.

Once destroy() has been called any further calls will be a no-op and no further errors except from _destroy() may be emitted as 'error'.

Implementors should not override this method, but instead implement readable._destroy().

Parameters

optional
error: Error

Error which will be passed as payload in 'error' event