okie
TypeScript icon, indicating that this package has built-in type declarations

1.0.1 • Public • Published

Okie

"Okie dokie, work work"

Dead simple worker threads pool.

const { Worker } = require('okie')

const worker = new Worker(n => n + 1, {
  max: 3 // defaults to os.cpus().length - 1
})

;(async () => {
  const result = await worker.run(1)
  console.log(result) // logs "2"

  worker.stop()
})()

Readme

Keywords

none

Package Sidebar

Install

npm i okie

Weekly Downloads

78

Version

1.0.1

License

MIT

Unpacked Size

5.68 kB

Total Files

7

Last publish

Collaborators

  • yyx990803