js-array-iterator

0.1.0 • Public • Published

js-array-iterator

Stepping through an array is sometimes very useful...sometimes. This module is not a replacement for async! it is something different, I needed to call a .next() method to continue the stepping and an event fired if the next array item is arrived:

var testIterator = new Iterator([0,1,2,3,4,5]);
 
testIterator.on('next', function (element) {
  console.log(element);
  testIterator.next();
}).on('end', function () {
  console.log('stepped through! ;)');
});
 
testIterator.next();

LICENSE

MIT

Readme

Keywords

none

Package Sidebar

Install

npm i js-array-iterator

Weekly Downloads

0

Version

0.1.0

License

MIT

Last publish

Collaborators

  • johannesboyne