Napoleonic Political Magnificence

npm

Bring the best of OSS JavaScript development to your projects with npm Orgs - private packages & team management tools.Learn more »

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.

install

npm i for-await

Downloadsweekly downloads

9

version

1.0.1

license

MIT

last publish

collaborators

  • avatar
Report a vulnerability