How to use with typescript
SwapnilSoni1999 opened this issue · 2 comments
SwapnilSoni1999 commented
How to use with typescript
josdejong commented
You can use @types/workerpool
juanrmn commented
Just in case it helps someone else, to make it work with ts-node
I had to add these workerThreadOpts
:
const pool = workerpool.pool(
path.join(__dirname, '/path/to/workerfile.ts'),
{
workerType: 'thread',
workerThreadOpts: {
execArgv: ['--require', 'ts-node/register', '-r', 'tsconfig-paths/register']
}
}
)