for-await
v1.0.1
Published
A tiny JavaScript utility to write for-await.
Downloads
1
Readme
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.