The node fs package has the following methods to list a directory:
fs.readdir(path, [callback]) Asynchronous readdir(3). Reads the
fs doesn't support filtering itself but if you don't want to filter youself then use glob
var glob = require('glob');
// options is optional
glob("**/*.js", options, function (er, files) {
// files is an array of filenames.
// If the `nonull` option is set, and nothing
// was found, then files is ["**/*.js"]
// er is an error object or null.
})