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

Duplex.from method | Node.js stream module | Bun

Duplex.from method | Node.js stream module | BunBuildDocsReferenceGuidesBlogDiscord/node:stream/default/Duplex/fromMfrom

Search the reference...

/

BuildDocsReferenceGuidesBlogDiscord/node:stream/default/Duplex/fromMfrom

method

stream.default.Duplex.fromstatic from(src: string | Blob | Promiseany> | ReadableStream | WritableStream | Iterableany, any, any> | AsyncIterableany, any, any> | (source: AsyncIterableany>) => AsyncIterableany> | (source: AsyncIterableany>) => Promisevoid> | ReadableWritablePairany, any> | ReadableStreamany> | WritableStreamany>): Duplex;

A utility method for creating duplex streams.

Stream converts writable stream into writable Duplex and readable stream to Duplex.Blob converts into readable Duplex.string converts into readable Duplex.ArrayBuffer converts into readable Duplex.AsyncIterable converts into a readable Duplex. Cannot yield null.AsyncGeneratorFunction converts into a readable/writable transform Duplex. Must take a source AsyncIterable as first parameter. Cannot yield null.AsyncFunction converts into a writable Duplex. Must return either null or undefinedObject ({ writable, readable }) converts readable and writable into Stream and then combines them into Duplex where the Duplex will write to the writable and read from the readable.Promise converts into readable Duplex. Value null is ignored.
Referenced typesinterface Blobreadonly size: numberreadonly type: stringarrayBuffer(): PromiseArrayBuffer>;

Consume the blob as an ArrayBuffer

bytes(): PromiseNonSharedUint8Array>;bytes(): PromiseUint8ArrayArrayBuffer>>;

Consume as a Uint8Array, backed by an ArrayBuffer

slice(start?: number,end?: number,contentType?: string): Blob;stream(): ReadableStreamNonSharedUint8Array>;stream(): ReadableStreamUint8ArrayArrayBuffer>>;

Returns a readable stream of the blob's contents

text(): Promisestring>;interface ReadableWritablePairR = any, W = any>readable: ReadableStreamR>writable: WritableStreamW>interface ReadableStreamR = any>readonly locked: booleancancel(reason?: any): Promisevoid>;getReader(options: { mode: 'byob' }): ReadableStreamBYOBReader;getReader(): ReadableStreamDefaultReaderR>;getReader(options?: ReadableStreamGetReaderOptions): ReadableStreamReaderR>;pipeThroughT>(transform: ReadableWritablePairT, R>,options?: StreamPipeOptions): ReadableStreamT>;pipeTo(destination: WritableStreamR>,options?: StreamPipeOptions): Promisevoid>;tee(): [ReadableStreamR>, ReadableStreamR>];values(options?: ReadableStreamIteratorOptions): ReadableStreamAsyncIteratorR>;interface WritableStreamW = any>readonly locked: booleanabort(reason?: any): Promisevoid>;close(): Promisevoid>;getWriter(): WritableStreamDefaultWriterW>;

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 →

Duplex.from method | Node.js stream module | Bun,AI智能索引,全网链接索引,智能导航,网页索引

    API documentation for method node:stream.default.Duplex.from | Bun