https://github.com/blackglory/extra-stream
🌿 Utilities for Stream
https://github.com/blackglory/extra-stream
browser esm library nodejs npm-package typescript
Last synced: 3 months ago
JSON representation
🌿 Utilities for Stream
- Host: GitHub
- URL: https://github.com/blackglory/extra-stream
- Owner: BlackGlory
- License: mit
- Created: 2021-03-05T14:02:29.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2023-06-11T03:06:00.000Z (about 3 years ago)
- Last Synced: 2025-07-01T09:54:58.633Z (about 1 year ago)
- Topics: browser, esm, library, nodejs, npm-package, typescript
- Language: TypeScript
- Homepage: https://www.npmjs.com/package/extra-stream
- Size: 394 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# extra-stream
Utilities for Stream.
## Install
```sh
npm install --save extra-stream
# or
yarn add extra-stream
```
## API
### ReadableStream, WritableStream, TransformStream, TextDecoderStream, TextEncoderStream
The WHATWG `ReadableStream`, `WritableStream`, `TransformStream`, `TextDecoderStream`, `TextEncoderStream`.
### toReadableStream
```ts
function toReadableStream(
iterable: Iterable | AsyncIterable
): ReadableStream
```
### toAsyncIterableIterator
```ts
function toAsyncIterableIterator(stream: ReadableStream): AsyncIterableIterator
```
`ReadableStream` should be an async iterable object,
but many runtimes don't support this yet.
### isNodeJSReadableStream
```ts
function isNodeJSReadableStream(val: unknown): val is NodeJS.ReadableStream
```
### isNodeJSWritableStream
```ts
function isNodeJSWritableStream(val: unknown): val is NodeJS.WritableStream
```