to-readable-stream

Convert a string/Buffer/Uint8Array to a readable stream

Usage no npm install needed!

<script type="module">
  import toReadableStream from 'https://cdn.skypack.dev/to-readable-stream';
</script>

README

to-readable-stream

Convert a string/Buffer/Uint8Array to a readable stream

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.