Research
Security News
Malicious npm Package Targets Solana Developers and Hijacks Funds
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
@akryum/tinypool
Advanced tools
A minimal and tiny Node.js Worker Thread Pool implementation, a fork of piscina, but with fewer features
Piscina: A fast, efficient Node.js Worker Thread Pool implementation
Tinypool is a fork of piscina. What we try to achieve in this library, is to eliminate some dependencies and features that our target users don't need (currently, our main user will be Vitest). Tinypool's install size (38KB) can then be smaller than Piscina's install size (6MB). If you need features like utilization or NAPI, Piscina is a better choice for you. We think that Piscina is an amazing library, and we may try to upstream some of the dependencies optimization in this fork.
✅ Smaller install size, 38KB
✅ Minimal
✅ No dependencies
✅ Physical cores instead of Logical cores with physical-cpu-count
❌ No utilization
❌ No NAPI
Written in TypeScript, and ESM support only. For Node.js 14.x and higher.
In case you need more tiny libraries like tinypool or tinyspy, please consider submitting an RFC
In main.js
:
import Tinypool from 'tinypool'
const pool = new Tinypool({
filename: new URL('./worker.js', import.meta.url).href,
})
const result = await pool.run({ a: 4, b: 6 })
console.log(result) // Prints 10
In worker.js
:
export default ({ a, b }) => {
return a + b
}
We have a similar API to Piscina, so for more information, you can read Piscina's detailed documentation and apply the same techniques here.
isolateWorkers
: Default to false
. Always starts with a fresh worker when running tasks to isolate the environment.workerId
: Each worker now has an id ( <= maxThreads
) that can be imported
from tinypool
in the worker itself (or process.__tinypool_state__.workerId
) Mohammad Bagher |
---|
The Vitest team for giving me the chance of creating and maintaing this project for vitest.
Piscina, because Tinypool is not more than a friendly fork of piscina.
FAQs
A minimal and tiny Node.js Worker Thread Pool implementation, a fork of piscina, but with fewer features
The npm package @akryum/tinypool receives a total of 41,354 weekly downloads. As such, @akryum/tinypool popularity was classified as popular.
We found that @akryum/tinypool demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Security News
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
Security News
Research
Socket researchers have discovered malicious npm packages targeting crypto developers, stealing credentials and wallet data using spyware delivered through typosquats of popular cryptographic libraries.
Security News
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.