node-foreach

1.0.0 • Public • Published

foreach

Iterate over array - control flow sync

Installation

npm install node-foreach

API

foreach(item, onRead, onComplete)

const foreach = require('node-foreach');
 
function onRead(item, index, next) {
    // item === 1, 2, 3
    // index === 0, 1, 2
    
    // move to next item
    next() 
}
 
function onComplete(err) {
    if (err) {
        console.log(err.message);
    }
}
 
foreach([1,2,3], onRead, onComplete);

Readme

Keywords

none

Package Sidebar

Install

npm i node-foreach

Weekly Downloads

0

Version

1.0.0

License

ISC

Unpacked Size

1.46 kB

Total Files

3

Last publish

Collaborators

  • mseld