Skip to content

Instantly share code, notes, and snippets.

@hernikplays
Created October 12, 2020 17:23
Show Gist options
  • Save hernikplays/f78a50d63ef61bd8f79e5ad81df6eefd to your computer and use it in GitHub Desktop.
Save hernikplays/f78a50d63ef61bd8f79e5ad81df6eefd to your computer and use it in GitHub Desktop.
Quickly rename manga pages to number
const fs = require("fs")
let folder = fs.readdirSync(".")
let i = 0;
folder.forEach((el)=>{
if(el == "rename.js") return;
fs.renameSync("./"+el, (el<10)?"00"+i+".jpg":"0"+i+".jpg")
i++
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment