Want to take your software engineering career to the next level? Join the mailing list for career tips & advice Click here

node-lupus

Aync looping for Node.js

Subscribe to updates I use node-lupus


Statistics on node-lupus

Number of watchers on Github 32
Number of open issues 1
Main language JavaScript
Open pull requests 1+
Closed pull requests 0+
Last commit about 6 years ago
Repo Created about 6 years ago
Repo Last Updated about 3 years ago
Size 264 KB
Organization / Authorrdegges
Contributors1
Page Updated
Do you use node-lupus? Leave a review!
View node-lupus activity
View on github
Book a Mock Interview With Me (Silicon Valley Engineering Leader, 100s of interviews conducted)
Software engineers: It's time to get promoted. Starting NOW! Subscribe to my mailing list and I will equip you with tools, tips and actionable advice to grow in your career.
Evaluating node-lupus for your project? Score Explanation
Commits Score (?)
Issues & PR Score (?)

node-lupus

NPM Version NPM Downloads Build Status

Async looping for Node.js

Banana Peel Sketch

Meta

  • Author: Randall Degges
  • Email: r@rdegges.com
  • Twitter: @rdegges
  • Site: http://www.rdegges.com
  • Status: production ready

Installation

To install lupus using npm, simply run:

$ npm install lupus

In the root of your project directory.

Usage

Once you have lupus installed, you can use it to easily iterate over a large set of numbers asynchronously (without locking up the CPU!):

var lupus = require('lupus');

lupus(0, 100000, function(n) {
  console.log("We're on:", n);
});

Want to run some code after the loop is finished? No problem!

var lupus = require('lupus');

lupus(0, 1000000, function(n) {
  console.log("We're on:", n);
}, function() {
  console.log('All done!');
});

If you were to try the same thing with a typical for loop, you'd use up a TON of memory on your computer, as well as block the Node.js process from executing any other code (bad). Don't believe me? Try running the code sample below yourself =)

for (var i = 0; i < 10000000; i++) {
  console.log("We're on:", i);
}

console.log('All done!');

Author's Note

I didn't want to call this library lupus, but I didn't really have a choice since looper was already taken! Darn.

I kinda-sorta figured oh well, let's just do this the weird way. Screw it.

Changelog

v0.0.1: 9-19-2014

- First release!
node-lupus open pull requests (View All Pulls)
  • Added promise support
node-lupus list of languages used
Other projects in JavaScript
Powered by Autocode - Instant Webhooks, Scripts and APIs
Autocode logo wordmark