from-node-stream
Version:
convert nodejs-stream into webstream
9 lines (8 loc) • 427 B
TypeScript
import type { Readable } from "stream";
/**
* Converts a Node.js Readable stream to a Web API ReadableStream
* @template T - The type of data being read (string or Uint8Array)
* @param i - The Node.js readable stream to convert
* @returns A Web API ReadableStream that wraps the Node.js stream
*/
export declare function fromReadable<T extends string | Uint8Array>(i: Readable | NodeJS.ReadableStream): ReadableStream<T>;