Skip to content

dubfib/thweads

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Simple multithreading for Node.js

Installation

npm install --save thweads

Usage

const Thweads = require('thweads');
const thweads = new Thweads({ thweads: 4 });
//or Thweads() to automatically set thweads

thweads.addAction(async () => {
    const workerData = new Array(10000000).fill(1);
    workerData.reduce(async (sum, num) => sum + num, 0);
});

thweads.startActions();
© Copyright 2023 dubfib - MIT License