Skip to content

Instantly share code, notes, and snippets.

@maxjing
Created January 15, 2019 04:34
Show Gist options
  • Save maxjing/3882413668e1a1177b73d9cb0d65a98c to your computer and use it in GitHub Desktop.
Save maxjing/3882413668e1a1177b73d9cb0d65a98c to your computer and use it in GitHub Desktop.
getMostRecentLocalFileName
function getMostRecentLocalFileName(dir) {
var files = fs.readdirSync(dir);
return _.max(files, function(f) {
var fullpath = path.join(dir, f);
return fs.statSync(fullpath).ctime;
});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment