Stream Iterators Utils
This is a toolbelt of functions to facilitate the usage of async iterators with Streams in Node.js. Requires Node 10+.
Install
npm i stream-iterators-utils
API
utils.toReadable(generator, opts)
Create a new Readable
stream from the async generator. opts
are
passed to the Readable
constructor
const toReadable = { 'a' 'b' 'c'} const stream = stream
utils.once(emitter, event)
Creates a promise that is resolved when the EventEmitter
emits the
given event or 'error'
.
const once = { const ee = process const value = await const err = 'kaboom' process try await catch err console }
License
MIT