Skip to content

Instantly share code, notes, and snippets.

View francescogior's full-sized avatar
🤔
I am thinking

Francesco Giordano francescogior

🤔
I am thinking
View GitHub Profile
@francescogior
francescogior / rename-files.js
Last active June 16, 2022 07:07
rename-files.js
const fs = require("fs");
const path = require("path");
const dir = process.argv.slice(2)[0];
if (dir == null) throw new Error("No directory provided");
const files = fs
.readdirSync(dir, { withFileTypes: true })
.filter((item) => item.isFile());