Socket
Socket
Sign inDemoInstall

pull-stream-to-async-iterator

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

pull-stream-to-async-iterator

Convert a pull stream to an async iterator


Version published
Weekly downloads
936
increased by41.39%
Maintainers
1
Weekly downloads
 
Created
Source

pull-stream-to-async-iterator

Build Status dependencies Status

Convert a pull stream to an async iterator

Install

npm install pull-stream-to-async-iterator

Usage

const toIterator = require('pull-stream-to-async-iterator')

const source = pull(
  pull.values([1, 2, 3, 4, 5]),
  pull.asyncMap((value, cb) => setTimeout(() => cb(null, value)))
)
const iterator = toIterator(source)

for await (const value of iterator) {
  console.log(value)
}

API

toIterator(source)

Convert a source pull stream into an async iterator. Returns an async iterator that can be used in a for/await/of loop.

Contribute

Feel free to dive in! Open an issue or submit PRs.

License

MIT © Alan Shaw

Keywords

FAQs

Package last updated on 18 Nov 2018

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc