aseemk / requireDir

Node.js helper to require() directories.
MIT License
484 stars 60 forks source link

Resolve #59, add an optional extensions parameter #60

Closed richardgarnier closed 5 years ago

richardgarnier commented 5 years ago

Added an optional array extensions to declare the extensions we'd like to require. All tests are green with both node v0.12 and node v10. I expect them to run on all major version but I did not try them all.

In order to keep the code simple, I replace the object iteration by an array iteration (using Object.keys), since anyway we were never using the values of the object.