Created
December 1, 2011 05:45
-
-
Save ruzz311/1414059 to your computer and use it in GitHub Desktop.
Display a list of files in a directory
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 fs = require('fs'); | |
fs.readdir('.', function (err, files) { | |
if (err) throw err; | |
for (var index in files) { | |
console.log(files[index]); | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I really thought this was going to be
ls
.