Skip to content

Instantly share code, notes, and snippets.

@kurorido
Created August 4, 2018 05:31
Show Gist options
  • Save kurorido/ef9f8ea355ada5b9f21677323c739fc3 to your computer and use it in GitHub Desktop.
Save kurorido/ef9f8ea355ada5b9f21677323c739fc3 to your computer and use it in GitHub Desktop.
const fs = require('fs')
const path = require('path')
const files = fs.readdirSync('.')
for (let file of files) {
// fs.renameSync(file,)
// console.log(file)
let ext = path.extname(file)
if (ext === '.JPG' || ext === '.JPEG') {
// console.log(path.basename(file, ext))
fs.renameSync(file, path.basename(file, ext) + '.jpg')
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment