method
tls.TLSSocket.from
src: string | Blob | Promise<any> | ReadableStream | WritableStream | Iterable<any, any, any> | AsyncIterable<any, any, any> | (source: AsyncIterable<any>) => AsyncIterable<any> | (source: AsyncIterable<any>) => Promise<void> | ReadableWritablePair<any, any> | ReadableStream<any> | WritableStream<any>
A utility method for creating duplex streams.
Streamconverts writable stream into writableDuplexand readable stream toDuplex.Blobconverts into readableDuplex.stringconverts into readableDuplex.ArrayBufferconverts into readableDuplex.AsyncIterableconverts into a readableDuplex. Cannot yieldnull.AsyncGeneratorFunctionconverts into a readable/writable transformDuplex. Must take a sourceAsyncIterableas first parameter. Cannot yieldnull.AsyncFunctionconverts into a writableDuplex. Must return eithernullorundefinedObject ({ writable, readable })convertsreadableandwritableintoStreamand then combines them intoDuplexwhere theDuplexwill write to thewritableand read from thereadable.Promiseconverts into readableDuplex. Valuenullis ignored.
Referenced types
interface Blob
Consume the blob as an ArrayBuffer
Consume as a Uint8Array, backed by an ArrayBuffer
Returns a readable stream of the blob's contents
interface ReadableWritablePair<R = any, W = any>
interface ReadableStream<R = any>
- ): ReadableStream<T>;