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

webworkers-helper

v0.9.10

Published

A simple Node.js webworker-threads module helper.

Readme

WebWorkers-Helper

A simple Node.js webworker-threads module helper.

Note #1 This module can be used with any existing version of node.js and npm.

How to install the module:

By using npmjs.org:

 npm install webworkers-helper --global --save 

 npm install webworkers-helper --save 

How to use the webworkers-helper module installed:

Creating and running a pool of n webworker-threads


new WorkersHelper().createPool(3, [[ test_cb1, [[1,2,3]] ], 
               [ (thread, args) => { return self.thread.id; }, [[3,4,5]] ], 
               [ function (thread, args) { var f = (p1,p2) => { return p1 + p2; }; f(10,20); return 'oops tid = ' + self.thread.id; }, [[5,6,7]] ]]).then(function (ret) { console.log("Completed"); console.log(JSON.stringify(ret)); });

Constructing and running three-dimensional grid of webworker-threads


var callback3d = [ [  
      [ [test_cb1,[[1,2,3]]], [test_cb1,[[4,5,6]]] ],
      [ [test_cb1,[[7,8,9]]], [test_cb1,[[10,11,12]]] ] ],

                  [
      [ [test_cb1,[[13,14,15]]], [test_cb1,[[16,17,18]]] ],
      [ [test_cb1,[[19,20,21]]], [test_cb1,[[22,23,24]]] ] ]
];

new WorkersHelper().createGrid3d({ "dim_x" : 2, "dim_y" : 2, "dim_z" : 2 }, callback3d).
    then(function (ret) { 

        for (var x = 0; x < 2; x++)
            for (var y = 0; y < 2; y++)
                for (var z = 0; z < 2; z++)
                    console.log(ret[x][y][z]);

        console.log("Completed3d");
    }, console.error);

...

# Constructor

`.ArgvParser`
#####.WorkersHelper()
WorkersHelper - constructs a webworkers helper object,

# Methods

##### .createPool( n, args ).then(function (ret) { ... })

Creating a pool of n webworker-threads. The first parameter of this method `n` is the actual number of threads in a team.
The second parameter `args` is an array of arguments. Each argument in the array is a tuple of two values for each 
particular thread to be executed. This tuple contains two values of a thread callback function and an array of arguments
for a specific running thread. `createPool` is the promise-based method that invokes `then` method's callback function at
the end of its execution. The parameter variable `ret` is normally an array of items, each one containing a return value of
a specific thread in a team.

##### .createGrid3d( dim3d, callbacks ).then(function (ret) { ... });

Creates a three-dimensional grid of threads to optimize the performance of solving a multidimensional problem.
The first argument of this function is an object having the following components `{ "dim_x" : n_x, "dim_y" : n_y, "dim_z" : n_z }.
The variables `n_x`,`n_y`,`n_z` normally represent the number of webworker-threads in each dimension. The using of following method 
is pretty much similar to using `createPool` method above with only one difference that we must create a three dimensional array of
its arguments such as a tuple of two values of either a thread callback function or an array of each threads arguments. Notice that,
the callback function for each particular thread in a grid might be different. The same as `createPool` method, `createGrid3d` 
is the promise-based asynchronously executed method that invokes `then` method's callback function at the end of its execution.
The parameter variable `ret` is a three-dimensional array, in which each item is actually a return value of each particular thread
in a grid.

# Conclusion

That's All Folks :)

# Author

Arthur V. Ratz @ Epsilon Software Development Labs.