Created
January 3, 2019 19:07
-
-
Save tylerpaige/f4653ab0f4f54c9dd5724a921f30cec6 to your computer and use it in GitHub Desktop.
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
const path = require('path') | |
const getAllFiles = (dir, ext = '.js') => { | |
return readDir(dir).then(children => { | |
return children | |
.filter(fileName => { | |
const fileExtension = path.extname(fileName); | |
return fileExtension.includes(ext); | |
}) | |
.map(fileName => path.resolve(dir, fileName)); | |
}); | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment