@codernex/nexpress 1.0.2 → 1.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/dist/index.js +4 -1
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -13,6 +13,8 @@ const __filename = fileURLToPath(import.meta.url);
13
13
  const __dirname = path.dirname(__filename);
14
14
  const homeDir = os.homedir();
15
15
  const acceptableArgs = ["--input", "--output", "--quality", "--help"];
16
+ const workerFileName = `image-processor${path.extname(__filename)}`;
17
+ const workerPath = path.join(__dirname, workerFileName);
16
18
  const args = process.argv.slice(2); // Use slice instead of splice
17
19
  const filteredArgs = args.filter((p) => {
18
20
  const [key] = p.split("=");
@@ -77,8 +79,9 @@ const allImages = fs.readdirSync(inputPath).filter((file) => {
77
79
  allImages.forEach((fileName) => {
78
80
  console.log("Processing:", fileName);
79
81
  const workerId = uuidV4();
80
- const worker = new Worker(path.join(__dirname, "image-processor.ts"), {
82
+ const worker = new Worker(workerPath, {
81
83
  // Use .js file
84
+ execArgv: process.execArgv,
82
85
  workerData: {
83
86
  input: path.join(inputPath, fileName),
84
87
  output: outputPath,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@codernex/nexpress",
3
- "version": "1.0.2",
3
+ "version": "1.0.3",
4
4
  "description": "Multi-threaded image batch processor CLI",
5
5
  "main": "dist/index.js",
6
6
  "type": "module",