Convert a string/promise/array/iterable/buffer/typedarray/arraybuffer/object into a stream


Keywords
stream, buffer, string, object, array, iterable, promise, promises, from, into, to, transform, convert, readable, pull, gulpfriendly, value, str, nodejs, npm-package, readable-stream
License
MIT
Install
npm install into-stream@5.1.1

Documentation

into-stream Build Status

Convert a string/promise/array/iterable/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> | 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> | Promise
Returns: Readable object stream

Related