JSPM

dank-do-while

1.0.1
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 9112
  • Score
    100M100P100Q142220F
  • License MIT

An asynchronous do-while-like function

Package Exports

  • dank-do-while

Readme

dank-do-while

An asynchronous do-while-like function for node

install

npm install dank-do-while

method

doWhile(eachFunction, doneFunction, concurrency);

eachFunction will be called once initially and then again for each time that next(truthy) is called

Signature is function(next)

doneFunction will be called once when next(falsy) is called

concurrency the number of concurrent eachFunction's that may be executed

example

import { doWhile } from 'dank-do-while';

doWhile(function (next) {	
    someAsyncFunction(function (err, result) {
        return next(result !== 'done');
    });
}, function () {
    console.log('done');
});