Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/sindresorhus/into-stream
Convert a string/promise/array/iterable/asynciterable/buffer/typedarray/arraybuffer/object into a stream
https://github.com/sindresorhus/into-stream
nodejs npm-package readable-stream stream
Last synced: 6 days ago
JSON representation
Convert a string/promise/array/iterable/asynciterable/buffer/typedarray/arraybuffer/object into a stream
- Host: GitHub
- URL: https://github.com/sindresorhus/into-stream
- Owner: sindresorhus
- License: mit
- Created: 2015-05-29T22:47:55.000Z (over 9 years ago)
- Default Branch: main
- Last Pushed: 2023-11-25T14:02:46.000Z (about 1 year ago)
- Last Synced: 2024-11-30T04:03:36.840Z (13 days ago)
- Topics: nodejs, npm-package, readable-stream, stream
- Language: JavaScript
- Homepage:
- Size: 43.9 KB
- Stars: 207
- Watchers: 7
- Forks: 14
- Open Issues: 4
-
Metadata Files:
- Readme: readme.md
- License: license
- Security: .github/security.md
Awesome Lists containing this project
- awesome - into-stream - Convert a string/promise/array/iterable/buffer/typedarray/arraybuffer/object into a stream (JavaScript)
- awesome-nodejs-cn - into-stream - 将 buffer/string/array/object 转化为流 (包 / 文件流)
- awesome-nodejs - into-stream - Convert a buffer/string/array/object into a stream. (Repository / Streams)
- awesome-nodejs-cn - into-stream - **star:207** 将缓冲区/字符串/数组/对象转换为流 (包 / 流)
- awesome-list - into-stream
- awesome-nodejs - into-stream - Convert a buffer/string/array/object into a stream. (Packages / Streams)
- awesome-nodejs - into-stream - Convert a string/promise/array/iterable/buffer/typedarray/arraybuffer/object into a stream - ★ 76 (Streams)
- awesome-nodejs-streams - sindresorhus/into-stream - Convert a buffer/string/array/object into a stream (Modules)
- awesome-node - into-stream - Convert a buffer/string/array/object into a stream. (Packages / Streams)
- awesome-nodejs-cn - into-stream - 将 buffer/string/array/object 转化为流. (目录 / 流处理)
README
# into-stream
> Convert a string/promise/array/iterable/asynciterable/buffer/typedarray/arraybuffer/object into a stream
Correctly handles backpressure.
## Install
```sh
npm install into-stream
```## Usage
```js
import intoStream from 'into-stream';intoStream('unicorn').pipe(process.stdout);
//=> 'unicorn'
```## API
### intoStream(input)
Type: `Buffer | TypedArray | ArrayBuffer | string | Iterable | AsyncIterable | Promise`\
Returns: [Readable stream](https://nodejs.org/api/stream.html#class-streamreadable)### intoStream.object(input)
Type: `object | Iterable | AsyncIterable | Promise`\
Returns: [Readable object stream](https://nodejs.org/api/stream.html#object-mode)## Related
- [to-readable-stream](https://github.com/sindresorhus/to-readable-stream) - Simpler version of this package
- [get-stream](https://github.com/sindresorhus/get-stream) - The opposite of this package