Created
January 29, 2015 17:02
-
-
Save radjivF/7084ecf63b32626e0f2f to your computer and use it in GitHub Desktop.
Rename a lot of files in a folder
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
var dirFolder= 'TODO/'; | |
var newName = 'TODO' | |
function renameFolder(dirFolder, newName){ | |
var fileList = fs.readdirSync(dirFolder); | |
console.log('we found '+ fileList.length +' files') | |
for(var i=1 ;i<fileList.length; i++){ | |
fs.renameSync(dirFolder+fileList[i], newName); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment