josdejong/workerpool

How to use with typescript

SwapnilSoni1999 opened this issue · 2 comments

How to use with typescript

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']
    }
  }
)