UNPKG

@arrows/worker

Version:

Simple, promise-based API for native worker threads (with pools)

12 lines (8 loc) 207 B
const myWorker = require("./myWorker") const main = async () => { const result = await Promise.all( Array.from({ length: 10 }, (_, i) => myWorker(BigInt(i))), ) console.log({ result }) } main()