Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

to-readable-stream

sindresorhus15.5mMIT4.0.0TypeScript support: included

Convert a value to a ReadableStream

stream, readablestream, string, buffer, uint8array, from, into, to, transform, convert, readable, pull

readme

to-readable-stream

Convert a value to a ReadableStream

Not to be confused with Node.js stream.Readable, in which case, stream.Readable#from() should be used instead.

Install

npm install to-readable-stream

Usage

import toReadableStream from 'to-readable-stream';

toReadableStream('🦄🌈');
//=> ReadableStream<'🦄🌈'>

API

toReadableStream(value)

Returns a ReadableStream.

value

The value to convert to a stream.