auto-image-converter 1.0.1 → 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/bin/index.js +3 -3
  2. package/package.json +1 -1
package/bin/index.js CHANGED
@@ -1,15 +1,15 @@
1
1
  #!/usr/bin/env node
2
2
  import path from "path";
3
- import { fileURLToPath } from "url";
3
+ import { fileURLToPath, pathToFileURL } from "url";
4
4
  import { convertImages } from "../lib/converter.js";
5
5
  import fs from "fs/promises";
6
6
 
7
7
  const __dirname = path.dirname(fileURLToPath(import.meta.url));
8
-
9
8
  const CONFIG_PATH = path.resolve(process.cwd(), "image-converter.config.js");
10
9
 
11
10
  try {
12
- const { default: config } = await import(CONFIG_PATH);
11
+ const configModule = await import(pathToFileURL(CONFIG_PATH).href);
12
+ const config = configModule.default;
13
13
  await convertImages(config);
14
14
  } catch (e) {
15
15
  console.error("❌ Ошибка загрузки конфигурации:", e.message);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "auto-image-converter",
3
- "version": "1.0.1",
3
+ "version": "1.0.3",
4
4
  "type": "module",
5
5
  "bin": {
6
6
  "auto-convert-images": "./bin/index.js"