Observation: A recent commit message mentions: [FIX]: add ts-node/esm loader to worker threads for dynamic auditor.
The Issue: Running ts-node in production or inside worker threads is generally considered an anti-pattern because it compiles TypeScript on the fly. This consumes significantly more memory, slows down thread startup time, and can cause memory leaks in a long-running Node.js application.
Improvement: You should pre-compile the worker thread scripts into plain JavaScript during your build step (using faster tools like swc or esbuild) and have the worker thread execute the compiled .js files instead of relying on ts-node at runtime.
Observation: A recent commit message mentions: [FIX]: add ts-node/esm loader to worker threads for dynamic auditor.
The Issue: Running ts-node in production or inside worker threads is generally considered an anti-pattern because it compiles TypeScript on the fly. This consumes significantly more memory, slows down thread startup time, and can cause memory leaks in a long-running Node.js application.
Improvement: You should pre-compile the worker thread scripts into plain JavaScript during your build step (using faster tools like swc or esbuild) and have the worker thread execute the compiled .js files instead of relying on ts-node at runtime.