image compression

This commit is contained in:
polv committed 2026-07-13 20:12:51 +07:00
1 parent e76a45f1d6
commit 8e6c5e2bda
2 files changed
+23 -1

No files matched your search

+3
View File
@@ -13,9 +13,12 @@ const WEBP_QUALITY = 75; // tweak 60-85 if you want smaller/larger
async function walk(dir) {
const entries = await fs.readdir(dir, { withFileTypes: true });
console.log(dir, entries.filter((e) => !e.isDirectory()).length);
const files = [];
for (const e of entries) {
const p = path.join(dir, e.name);
if (p === OUT_DIR) continue;
if (e.isDirectory()) files.push(...(await walk(p)));
else files.push(p);
}