into-stream
    TypeScript icon, indicating that this package has built-in type declarations

    7.0.0 • Public • Published

    into-stream

    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

    import intoStream from '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

    Install

    npm i into-stream

    DownloadsWeekly Downloads

    3,737,593

    Version

    7.0.0

    License

    MIT

    Unpacked Size

    7.19 kB

    Total Files

    5

    Last publish

    Collaborators

    • sindresorhus