1.0.4 • Published 8 years ago

node-while-loop v1.0.4

Weekly downloads
13
License
MIT
Repository
github
Last release
8 years ago

node-while-loop Build Status

A while loop alternative for Nodejs based on promises.

Install

$ npm install --save node-while-loop

Usage

var loop = require('node-while-loop');

var i = 1;
loop.while(function () {
    return i * i < 10;
}, function () {
    console.log(i);
    i++;
});
console.log('Hello Node!');

/* Output
Hello Node!
1
2
3
*/

API

while(condition, action)

condition function refers to a bool returning function which when returns false, breaks the loop.

action function refers to the task which needs to be iteratively performed.

License

MIT © Mandeep Singh

TODO

Tests

1.0.4

8 years ago

1.0.3

8 years ago

1.0.2

8 years ago

1.0.1

8 years ago

1.0.0

8 years ago