1.1.0 • Published 6 years ago

async-chunks v1.1.0

Weekly downloads
13
License
MIT
Repository
github
Last release
6 years ago

Async Chunks

Get an async iterator over chunks in a stream.

Installation

npm install --save async-chunks

Usage

const fs = require('fs')
const asyncChunks = require('async-chunks')

// Print current file to stdout
const stream = fs.createReadStream(__filename)

for await (const chunk of asyncChunks(stream)) {
  process.stdout.write(chunk)
}

API

asyncChunks(stream: Readable) => AsyncIterableIterator<string | Buffer>

Returns a new async iterator that iterates over all the chunks in the stream.

1.1.0

6 years ago

1.0.0

6 years ago