for-await

1.0.1 • Public • Published

for-await

A tiny JavaScript utility to write for-await.

npm version Build Status Coverage Status dependencies Status


Install

npm install --save for-await
const forAwait = require('for-await');

Usage

forAwait((item) => {
  // iteration
}).of(asyncGenerator()).then(() => {
  // done
});
 

API

forAwait( fn:function ).of( source:asyncIterable|syncIterable ):Promise<undefined>

fn is called with item, index, source.

of returns a Promise that resolves when iteration has finished.

Readme

Keywords

Package Sidebar

Install

npm i for-await

Weekly Downloads

0

Version

1.0.1

License

MIT

Last publish

Collaborators

  • moeriki