SyntaxFix
Write A Post
Hire A Developer
Questions
Another option is to use the package require-dir which let's you do the following. It supports recursion as well.
var requireDir = require('require-dir'); var dir = requireDir('./path/to/dir');