delay-for-array
v1.0.25
Published
Loop over array but with a time delay
Downloads
3
Maintainers
Readme
SUPERSEEDED BY iterate-with-delay
USE THIS MODULE INSTEAD: https://www.npmjs.com/package/iterate-with-delay
Loop over array but with time delay
Usage
npm install delay-for-array
Features
- iterates over array but pauses inbetween
- uses callback for each element
- calls extra callback when done
Example
delayarr = require('delay-for-array')
arr = ["one","two","three"];
delayarr.each( arr, { time:1000 }, function(el,k){
console.log( new Date()+"element received: "+k+" -> "+el );
},function(num){
console.log("finished processing "+num+" items");
});