into-stream ![Build Status](https://camo.githubusercontent.com/c1c386b0c888d8d09d66ac2977cf8e0996364aa2e250f7a3fce14e9311bf51ff/68747470733a2f2f7472617669732d63692e636f6d2f73696e647265736f726875732f696e746f2d73747265616d2e7376673f6272616e63683d6d6173746572)
Convert a string/promise/array/iterable/asynciterable/buffer/typedarray/arraybuffer/object into a stream
Correctly chunks up the input and handles backpressure.
Install
$ npm install into-stream
Usage
const intoStream = require('into-stream');
intoStream('unicorn').pipe(process.stdout);
//=> 'unicorn'
API
intoStream(input)
Type: Buffer | TypedArray | ArrayBuffer | string | Iterable<Buffer | string> | AsyncIterable<Buffer | string> | Promise
Returns: Readable stream
Adheres to the requested chunk size, except for array
where each element will be a chunk.
intoStream.object(input)
Type: object | Iterable<object> | AsyncIterable<object> | Promise
Returns: Readable object stream
Related
- to-readable-stream - Simpler version of this module