Skip to content

Instantly share code, notes, and snippets.

@ruzz311
Created December 1, 2011 05:45
Show Gist options
  • Save ruzz311/1414059 to your computer and use it in GitHub Desktop.
Save ruzz311/1414059 to your computer and use it in GitHub Desktop.
Display a list of files in a directory
var fs = require('fs');
fs.readdir('.', function (err, files) {
if (err) throw err;
for (var index in files) {
console.log(files[index]);
}
});
@adunkman
Copy link

I really thought this was going to be ls.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment