Created
August 4, 2018 05:31
-
-
Save kurorido/ef9f8ea355ada5b9f21677323c739fc3 to your computer and use it in GitHub Desktop.
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 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