Created
July 9, 2023 17:20
-
-
Save PatheticMustan/f2514b11bf547394bb2e24c1a0ebe5ba to your computer and use it in GitHub Desktop.
remove dupe photos
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const testFolder = './'; | |
const fs = require('fs'); | |
let n = 0; | |
fs.readdir(testFolder, (err, files) => { | |
files.forEach(file => { | |
if (file.includes("(1)") || file.includes("(2)") || file.includes("(3)")) { | |
//console.log(file); | |
n++; | |
fs.unlinkSync(file) | |
} | |
}); | |
console.log(`cleaned ${n} dupes`) | |
}); | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment