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 🙏

© 2026 – Pkg Stats / Ryan Hefner

controllency

v0.1.3

Published

Launch concurrent processes (Promises) in a controlled way

Readme

Controllency

Launch concurrent functions (Promises) in a controlled way.

Build Status Node Version Coverage

Demo example View demo in JSFiddle

With this module you can control how many promises are being executed at the same time when you have a large quantity of them. You can do things like:

Hey Controllency, launch all these hundreds of Promises, but execute 3 of them as maximum at once. Take the time you need. And please, signal me whenever some of them finishes.

Controllency uses a little in-memory "queue" to store the pending promises to be executed as soon as possible. You can push new promises while the previous ones are still being executed or queued to be executed. When a Promise is resolved or rejected, Controllency emit an event which you can suscribe to if you need to know the succeed result or the failing reason.

Here there is a simple schema about how Controllency works:

controllency_schema

Installation

npm install controllency --save

Usage

Example 1: basic usage

import { Controllency } from 'controllency';

let controllency = new Controllency({ maxConcurrency: 2 });

seriallency.push({ fn: hardWorkFn, params: [1]});
seriallency.push({ fn: hardWorkFn, params: [2]});
seriallency.push({ fn: hardWorkFn, params: [3]});
seriallency.push({ fn: hardWorkFn, params: [4]});
seriallency.push({ fn: hardWorkFn, params: [5]});
seriallency.push({ fn: hardWorkFn, params: [6]});

function hardWorkFn(numParam: number): Promise<any>{
    console.log(`Executing hardWorkFn. numParam:${numParam}`);
    return new Promise(resolve => {
        // ... do some async process
        setImmediate(resolve);
    });
}

// If we supose that hardWorkFn returned promise takes 1 second to be resolved, output is:
// At second 0: Executing hardWorkFn. numParam: 1
// At second 0: Executing hardWorkFn. numParam: 2
// At second 1: Executing hardWorkFn. numParam: 3
// At second 1: Executing hardWorkFn. numParam: 4
// At second 2: Executing hardWorkFn. numParam: 5
// At second 2: Executing hardWorkFn. numParam: 6