Skip to content

Instantly share code, notes, and snippets.

@tanyagupta
Created December 5, 2015 21:47
Show Gist options
  • Save tanyagupta/aea1c808aac1247ef3fe to your computer and use it in GitHub Desktop.
Save tanyagupta/aea1c808aac1247ef3fe to your computer and use it in GitHub Desktop.
FILTERED LS (Exercise 5 of 13)
var fs = require('fs')
var path = require('path')
fs.readdir(process.argv[2], function (err, list) {
list.forEach(function (file) {
if (path.extname(file) === '.' + process.argv[3])
console.log(file)
})
})
@Abed-Murad
Copy link

thanks

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