node-web-stream-adapters
TypeScript icon, indicating that this package has built-in type declarations

0.2.1 • Public • Published

node-web-stream-adapters

Utilities to convert Node.js Readable ans Writable streams to web ReadableStream and WritableStream streams.

These helpers are are usefull since Readable.toWeb, Readable.toWeb, Writable.toWeb and Writable.fromWeb are experimentals as of Node.js version 22.

##Usage:

npm i node-readable-stream
import fs from "fs";
import { toReadableStream } from "node-readable-stream";

const buffer = readFileAsync('some-file');
const stream = createReadableStreamFromReadable(Readable.from(buffer));
// or
const stream = createReadableStreamFromBuffer(buffer);

Package Sidebar

Install

npm i node-web-stream-adapters

Weekly Downloads

263

Version

0.2.1

License

MIT

Unpacked Size

26.8 kB

Total Files

26

Last publish

Collaborators

  • bstefanescu