Skip to content

Instantly share code, notes, and snippets.

@radjivF
Created January 29, 2015 17:02
Show Gist options
  • Save radjivF/7084ecf63b32626e0f2f to your computer and use it in GitHub Desktop.
Save radjivF/7084ecf63b32626e0f2f to your computer and use it in GitHub Desktop.
Rename a lot of files in a folder
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