import { randomUUID } from 'node:crypto'
import { performance } from 'node:perf_hooks'
+import { existsSync } from 'node:fs'
import type {
MessageValue,
PromiseResponseWrapper,
private checkFilePath (filePath: string): void {
if (
filePath == null ||
+ typeof filePath !== 'string' ||
(typeof filePath === 'string' && filePath.trim().length === 0)
) {
throw new Error('Please specify a file with a worker implementation')
}
+ if (!existsSync(filePath)) {
+ throw new Error(`Cannot find the worker file '${filePath}'`)
+ }
}
private checkNumberOfWorkers (numberOfWorkers: number): void {