into-stream

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

MIT 15 个版本
安装
npm install into-stream
yarn add into-stream
pnpm add into-stream
bun add into-stream
README

into-stream

Convert a string/promise/array/iterable/asynciterable/uint8array/typedarray/arraybuffer/readablestream/object into a stream

Correctly handles backpressure.

Install

npm install into-stream

Usage

import intoStream from 'into-stream';

intoStream('unicorn').pipe(process.stdout);
//=> 'unicorn'

API

intoStream(input)

Type: Uint8Array | TypedArray | ArrayBuffer | string | Iterable<string | Uint8Array | TypedArray> | AsyncIterable<string | Uint8Array | TypedArray> | ReadableStream | Promise
Returns: Readable stream

intoStream.object(input)

Type: object | Iterable<object> | AsyncIterable<object> | Promise
Returns: Readable object stream

Limitations

The streams returned by this package cannot be used with the stdio option of Node.js child_process methods. Use fs.createReadStream() instead.

版本列表
9.1.0 2026-02-02
9.0.0 2025-09-09
8.0.1 2023-11-25
8.0.0 2023-05-26
7.0.0 2021-04-16
6.0.0 2020-08-13
5.1.1 2019-10-04
5.1.0 2019-04-05
5.0.0 2019-03-11
4.0.0 2018-10-12
3.1.0 2016-11-29
3.0.0 2016-08-27
2.0.1 2016-04-28
2.0.0 2015-06-27
1.0.0 2015-05-29