multi-thread.js

0.0.1 • Public • Published

thread.js

Add Java-like multi-threading to node.js applications, without having to write a separate file.

Usage

Thread.js has one method that you pass a function to. It will then run that function on a separate thread.

var threadjs = require('thread.js');
threadjs.runTask(function () {
  for (var i = 0; i < 100000, i++) {
  }

  console.log("Done.");
});

How Does it Work?

The runTask method converts the passed-in function into a string. And then, it will spawn a new node.js process, with the function's string as a command-line argument.

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 0.0.1
    0
    • latest

Version History

  • Version
    Downloads (Last 7 Days)
    • Published
  • 0.0.1
    0

Package Sidebar

Install

npm i multi-thread.js

Weekly Downloads

0

Version

0.0.1

License

none

Last publish

Collaborators

  • manlycoffee