Constants
This file defines helper constants for resolving the paths to the thread and worker bootstrap wrapper files in the @sodacore/core
library. These constants are used to locate the entry points for thread and worker processes.
Features
- Path Resolution: Uses the
resolve
utility to compute absolute paths to the thread and worker wrapper scripts. - Centralized Constants: Provides a single source of truth for wrapper script locations.
Usage
typescript
import { PATH_THREAD_WRAPPER, PATH_WORKER_WRAPPER } from './helper/constants';
console.log('Thread wrapper path:', PATH_THREAD_WRAPPER);
console.log('Worker wrapper path:', PATH_WORKER_WRAPPER);
API
PATH_THREAD_WRAPPER: string
The resolved absolute path to the thread bootstrap wrapper (../../bootstrap/thread.js
).
PATH_WORKER_WRAPPER: string
The resolved absolute path to the worker bootstrap wrapper (../../bootstrap/worker.js
).
Notes
- The
resolve
function is imported from the localutils
module. - These constants are typically used when spawning new thread or worker processes to ensure the correct entry file is used.