The directory all my files are in is: \'/usr/home/jordan\' and I have many files under there (in the directory itself, but one file that is named with a .txt extension.
var files = fs.readdirSync(homedir); var path = require('path'); for(var i in files) { if(path.extname(files[i]) === ".txt") { //do something } }