-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.js
More file actions
23 lines (20 loc) · 766 Bytes
/
Copy pathindex.js
File metadata and controls
23 lines (20 loc) · 766 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
const { program } = require('commander');
const { compressAndResizeImages } = require('./compress.js');
program
.option('-s, --source <sourceDir>', 'Source directory', 'src')
.option('-d, --dest <destDir>', 'Destination directory', 'dst')
.option('-w, --width <maxWidth>', 'Max width', 1920)
.option('-h, --height <maxHeight>', 'Max height', 1920)
.option('-q, --quality <quality>', 'Quality (1-100)', 60)
.option('-f, --format <format>', 'Output format (e.g., jpg, png, webp)', 'jpg');
program.parse(process.argv);
const options = program.opts();
compressAndResizeImages(
options.source,
options.dest,
parseInt(options.width),
parseInt(options.height),
parseInt(options.quality),
options.format,
false // auf true setzen um zu cropen
);