one-image-optimizer 1.0.1 → 1.0.2

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.
package/bin/compress.js CHANGED
@@ -0,0 +1,35 @@
1
+ #!/usr/bin/env node
2
+
3
+ const compressImageMain = require("../src/imagescompress");
4
+ const { loadConfig } = require("../src/utils");
5
+ const chalk = require("chalk");
6
+
7
+ async function run() {
8
+ try {
9
+ console.log(
10
+ chalk.cyan.bold(
11
+ "\n╔════════════════════════════════════════════════════════╗",
12
+ ),
13
+ );
14
+ console.log(
15
+ chalk.cyan.bold(
16
+ "║ ONE IMAGE OPTIMIZER - Compress Only ║",
17
+ ),
18
+ );
19
+ console.log(
20
+ chalk.cyan.bold(
21
+ "╚════════════════════════════════════════════════════════╝\n",
22
+ ),
23
+ );
24
+
25
+ const config = loadConfig();
26
+ await compressImageMain(config);
27
+
28
+ console.log(chalk.green.bold("✅ Compression complete!\n"));
29
+ } catch (error) {
30
+ console.error(chalk.red("❌ Error:"), error.message);
31
+ process.exit(1);
32
+ }
33
+ }
34
+
35
+ run();
@@ -0,0 +1,35 @@
1
+ #!/usr/bin/env node
2
+
3
+ const emptyFoldersMain = require("../src/emptythefolder");
4
+ const { loadConfig } = require("../src/utils");
5
+ const chalk = require("chalk");
6
+
7
+ async function run() {
8
+ try {
9
+ console.log(
10
+ chalk.cyan.bold(
11
+ "\n╔════════════════════════════════════════════════════════╗",
12
+ ),
13
+ );
14
+ console.log(
15
+ chalk.cyan.bold(
16
+ "║ ONE IMAGE OPTIMIZER - Empty Folders Only ║",
17
+ ),
18
+ );
19
+ console.log(
20
+ chalk.cyan.bold(
21
+ "╚════════════════════════════════════════════════════════╝\n",
22
+ ),
23
+ );
24
+
25
+ const config = loadConfig();
26
+ await emptyFoldersMain(config);
27
+
28
+ console.log(chalk.green.bold("✅ Folders emptied!\n"));
29
+ } catch (error) {
30
+ console.error(chalk.red("❌ Error:"), error.message);
31
+ process.exit(1);
32
+ }
33
+ }
34
+
35
+ run();
@@ -0,0 +1,9 @@
1
+ #!/usr/bin/env node
2
+
3
+ const runAllOptimizations = require("../src/index");
4
+
5
+ // Run the main optimization function
6
+ runAllOptimizations().catch((error) => {
7
+ console.error("Fatal error:", error);
8
+ process.exit(1);
9
+ });
package/bin/rename.js CHANGED
@@ -0,0 +1,35 @@
1
+ #!/usr/bin/env node
2
+
3
+ const renameImagesMain = require("../src/imgfolderrename");
4
+ const { loadConfig } = require("../src/utils");
5
+ const chalk = require("chalk");
6
+
7
+ async function run() {
8
+ try {
9
+ console.log(
10
+ chalk.cyan.bold(
11
+ "\n╔════════════════════════════════════════════════════════╗",
12
+ ),
13
+ );
14
+ console.log(
15
+ chalk.cyan.bold(
16
+ "║ ONE IMAGE OPTIMIZER - Rename Only ║",
17
+ ),
18
+ );
19
+ console.log(
20
+ chalk.cyan.bold(
21
+ "╚════════════════════════════════════════════════════════╝\n",
22
+ ),
23
+ );
24
+
25
+ const config = loadConfig();
26
+ await renameImagesMain(config);
27
+
28
+ console.log(chalk.green.bold("✅ Renaming complete!\n"));
29
+ } catch (error) {
30
+ console.error(chalk.red("❌ Error:"), error.message);
31
+ process.exit(1);
32
+ }
33
+ }
34
+
35
+ run();
package/bin/webp.js CHANGED
@@ -0,0 +1,35 @@
1
+ #!/usr/bin/env node
2
+
3
+ const convertImageToWebpMain = require("../src/webpconverter");
4
+ const { loadConfig } = require("../src/utils");
5
+ const chalk = require("chalk");
6
+
7
+ async function run() {
8
+ try {
9
+ console.log(
10
+ chalk.cyan.bold(
11
+ "\n╔════════════════════════════════════════════════════════╗",
12
+ ),
13
+ );
14
+ console.log(
15
+ chalk.cyan.bold(
16
+ "║ ONE IMAGE OPTIMIZER - WebP Only ║",
17
+ ),
18
+ );
19
+ console.log(
20
+ chalk.cyan.bold(
21
+ "╚════════════════════════════════════════════════════════╝\n",
22
+ ),
23
+ );
24
+
25
+ const config = loadConfig();
26
+ await convertImageToWebpMain(config);
27
+
28
+ console.log(chalk.green.bold("✅ WebP conversion complete!\n"));
29
+ } catch (error) {
30
+ console.error(chalk.red("❌ Error:"), error.message);
31
+ process.exit(1);
32
+ }
33
+ }
34
+
35
+ run();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "one-image-optimizer",
3
- "version": "1.0.1",
3
+ "version": "1.0.2",
4
4
  "main": "src/index.js",
5
5
  "description": "Optimize PNG, JPEG images by compressing them and converting them to webp format.",
6
6
  "keywords": ["npm", "image", "optimizer", "webp", "compress", "tool"],