温馨提示:本站仅提供公开网络链接索引服务,不存储、不篡改任何第三方内容,所有内容版权归原作者所有
AI智能索引来源:http://www.bun.com/reference/globals/ReadableStream/pipeTo
点击访问原文链接

ReadableStream.pipeTo method | globals module | Bun

ReadableStream.pipeTo method | globals module | BunBuildDocsReferenceGuidesBlogDiscord/Globals/ReadableStream/pipeToMpipeTo

Search the reference...

/

BuildDocsReferenceGuidesBlogDiscord/Globals/ReadableStream/pipeToMpipeTo

method

ReadableStream.pipeTopipeTo(destination: WritableStreamR>,options?: StreamPipeOptions): Promisevoid>;Referenced typesclass WritableStreamW = any>

This Streams API interface provides a standard abstraction for writing streaming data to a destination, known as a sink. This object comes with built-in backpressure and queuing.

MDN Reference

readonly locked: booleanabort(reason?: any): Promisevoid>;close(): Promisevoid>;getWriter(): WritableStreamDefaultWriterW>;interface StreamPipeOptionspreventAbort?: booleanpreventCancel?: booleanpreventClose?: boolean

Pipes this readable stream to a given writable stream destination. The way in which the piping process behaves under various error conditions can be customized with a number of passed options. It returns a promise that fulfills when the piping process completes successfully, or rejects if any errors were encountered.

Piping a stream will lock it for the duration of the pipe, preventing any other consumer from acquiring a reader.

Errors and closures of the source and destination streams propagate as follows:

An error in this source readable stream will abort destination, unless preventAbort is truthy. The returned promise will be rejected with the source's error, or with any error that occurs during aborting the destination.

An error in destination will cancel this source readable stream, unless preventCancel is truthy. The returned promise will be rejected with the destination's error, or with any error that occurs during canceling the source.

When this source readable stream closes, destination will be closed, unless preventClose is truthy. The returned promise will be fulfilled once this process completes, unless an error is encountered while closing the destination, in which case it will be rejected with that error.

If destination starts out closed or closing, this source readable stream will be canceled, unless preventCancel is true. The returned promise will be rejected with an error indicating piping to a closed stream failed, or with any error that occurs during canceling the source.

The signal option can be set to an AbortSignal to allow aborting an ongoing pipe operation via the corresponding AbortController. In this case, this source readable stream will be canceled, and destination aborted, unless the respective options preventCancel or preventAbort are set.

signal?: AbortSignal

Resources

ReferenceDocsGuidesDiscordMerch StoreGitHubBlog 

Toolkit

RuntimePackage managerTest runnerBundlerPackage runner

Project

Bun 1.0Bun 1.1Bun 1.2Bun 1.3RoadmapContributingLicense

Baked with ❤️ in San Francisco

We're hiring →

ReadableStream.pipeTo method | globals module | Bun,AI智能索引,全网链接索引,智能导航,网页索引

    API documentation for method globals.ReadableStream.pipeTo | Bun