Skip to content

Instantly share code, notes, and snippets.

@yoshimax
Created December 14, 2010 21:53
Show Gist options
  • Select an option

  • Save yoshimax/741175 to your computer and use it in GitHub Desktop.

Select an option

Save yoshimax/741175 to your computer and use it in GitHub Desktop.
// $ node rename.js
var fs = require('fs');
var path = '/Users/max/Downloads/test/';
fs.readdir(path, function(err, files) {
files.forEach(function (val, index, array) {
if(val.match(/mp4$/)) fs.renameSync(path + val, path + unescape(val));
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment