npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2025 – Pkg Stats / Ryan Hefner

missionworks

v1.0.3

Published

`missionWorks.js` is a light-weighted open-source nodejs module which provides some asynchronous programming features.

Readme

missionWorks.js

missionWorks.js is a light-weighted open-source nodejs module which provides some asynchronous programming features.

Features

  • Easy to create asynchronous programs.
  • Dynamic mission creation.
  • Automatically deal with dependencies (just like async.auto in Async.js).
  • Control the maxium missions running at the sametime.
  • Really light-weighted, less than 100 lines.

Install

npm install missionworks

Usage

Create a mission

var mission = require('missionworks').assign(name, func, callback, depend);

name is the name of this mission. The only usage of name is you can use mission.name to get the label in order to help yourself. It is prefectly fine to put a object or something else as the name. It is also no problem to have exactly same names. Name do not influence how missionWork works at all.

func is the function that will be called when the mission is ready to go. It will be called with a callback function. The func should call this callback with any parameter you want.

callback is the function that will be called when the callback in func is called. It is useful to use with other library such as Async.js.

depend is a mission or an array of missions that must be done before this mission is called.

This method will return a mission object which you can add to new mission's depend list.

Change maxium count of missions running at the same time

require('missionworks').setMaxParallel(limit);

limit is the count of maxium missions can run at the same time.

This method will return missionWorks self so you can do chaining stuff.

Define mission start or end functions

require('missionworks').setStartFunction(func); require('missionworks').setEndFunction(func);

When a mission is started or ended, the func you indicated will be called with the mission object.

Example

'use strict';

var mw = require('./missionWorks.js');
mw.setStartFunction(function(mission) {
	console.info(`Mission ${mission.name} started.`);
});
mw.setEndFunction(function(mission) {
	console.info(`Mission ${mission.name} completed.`);
});

//This step will create a mission named "SampleMission". In fact, the name for a mission
//does not influence anything except the "name" property of a mission instance.
var sample = mw.assign('SampleMission', function(callback) {
	console.info('Wow, the sample mission started! It will take 3 seconds to finish.');
	setTimeout(callback, 3000);
}, function() {
	console.info('Callback for the sample mission has been called.');
});

console.info(sample.name); //SampleMission

var waitGuy = mw.assign('WaitGuy', function(callback) {
	console.info('I will start after SampleMission is completed.');
	setTimeout(callback, 1000);
}, null, sample);

var missionList = [];

mw.setMaxParallel(3);
for (let i = 0; i < 8; i++) {
	missionList.push(mw.assign(`Mission-${i}`, function(callback) {
		setTimeout(callback, i * 1000); //The later the mission is, the longer it take.
	}, null, waitGuy));
}

var waitALOTGuy = mw.assign('waitALOTGuy', function(callback) {
	console.info('I will start after all mission list completed.');
	setTimeout(callback, 1000);
}, null, missionList);

License

MIT