This is an early version of this module. It's intended to repeat or execute a function multiple times define by the second argument, you use a third argument as an optional delay between executions. At the end it returns a promise that resolves to an array with the results of each execution. It should work with async functions as well.
const { repeat } = require("function-looper");
function whateverFunction(iterator) {
return "Hello" + iterator;
}
repeat(whateverFunction, 6, 50000).then(console.log);
The third param is optional and defaults to 0