Created
January 15, 2019 04:34
-
-
Save maxjing/3882413668e1a1177b73d9cb0d65a98c to your computer and use it in GitHub Desktop.
getMostRecentLocalFileName
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
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