pull-awaitable

1.0.0 • Public • Published

pull-awaitable

Converts a pull-stream to an Async Iterable, usable with for-await-of

npm install --save pull-awaitable

NOTE! AsyncIterables and for-await-of are only supported in in Node.js v10, Firefox 57+, and Chrome 66.

Usage

const pull = require('pull-stream')
const awaitable = require('pull-awaitable')
 
async function main() {
  const stream = pull.values(['a', 'b']);
  for await (const x of awaitable(stream)) {
    console.log(x); // 'a'
                    // 'b'
  }
}
 
main()

License

MIT

/pull-awaitable/

    Package Sidebar

    Install

    npm i pull-awaitable

    Weekly Downloads

    47

    Version

    1.0.0

    License

    MIT

    Unpacked Size

    2.65 kB

    Total Files

    5

    Last publish

    Collaborators

    • staltz