-import { join } from 'path'
-import { DynamicThreadPool, FixedThreadPool } from 'poolifier'
-import { MyData, MyResponse } from './worker'
+import { dirname, extname, join } from 'node:path'
+import { fileURLToPath } from 'node:url'
+import type { MyData, MyResponse } from './worker.js'
+import {
+ DynamicThreadPool,
+ FixedThreadPool,
+ availableParallelism
+} from 'poolifier'
+
+const workerFile = join(
+ dirname(fileURLToPath(import.meta.url)),
+ `worker${extname(fileURLToPath(import.meta.url))}`
+)