1.1.1 • Published 6 years ago

ai-event v1.1.1

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

ai-event

Travis Build Status NPM downloads

Create an async iterable from an event emitter.

This module transform an event emitter into an async iterable.

Async iterable fun

This module is part of Async iterable fun, a complete toolset of modules to work with async iterables.

Usage

Transform a node stream into an aync iterable:

const fromEvent = require("ai-event");
import { createReadStream } from "fs";

const stream = createReadStream("aFile", "utf8");
const iterable = fromEvent(stream, "data");
for await (const chunk of iterable) {
  console.log(chunk);
}

This will output aFile content

API

Install

With npm installed, run

npm install --save ai-event

See Also

License

MIT

1.1.1

6 years ago

1.1.0

6 years ago

1.0.0

6 years ago

0.0.1

6 years ago