Skip to content
main
Switch branches/tags
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.

to-readable-stream

Convert a string/Buffer/Uint8Array to a Node.js stream.Readable, which should not be confused with ReadableStream

If you target Node.js 12 or later, you can use stream.Readable#from() instead.

Install

$ npm install to-readable-stream

Usage

import toReadableStream from 'to-readable-stream';

toReadableStream('🦄🌈').pipe(process.stdout);

API

toReadableStream(value)

Returns a stream.Readable.

value

Type: string | Buffer | Uint8Array

Value to convert to a stream.

Related


Get professional support for this package with a Tidelift subscription
Tidelift helps make open source sustainable for maintainers while giving companies
assurances about security, maintenance, and licensing for their dependencies.