1.0.3 • Published 3 years ago

for-for-for v1.0.3

Weekly downloads
-
License
MIT
Repository
github
Last release
3 years ago

For-loop running on multiple threads

image

for-for-for is 40 lines of syntactic sugar wrapper, to quickly use Node's libuv threads, in a simple for-loop flavor.

Usage

npm install for-for-for

Because reasons™, to use the await variant, you need to encapsulate your code in async function.

var fff = require('for-for-for');

var main = async function(){

    await fff(0, 100, 5, function(i, next){
        // ... some async action here.
        next();
    });

    console.log('done');

    // ... continue here...
};

main();

or, you could use the done() callback:

var fff = require('for-for-for');

fff(0, 100, 5, function(i, next){
    // ... some async action here.
}, function(){
    console.log('done');
});
1.0.3

3 years ago

1.0.2

3 years ago

1.0.1

3 years ago

1.0.0

3 years ago