node package manager
Orgs are free. Discover, share, and reuse code in your team. Create a free org »

dirrequire

devDependency Status

dirrequire library for async require files in directory node.js.

Installation

$ npm install dirrequire

Api

dirrequire(dirname, [include], callback)
 
include – array of file extensions for require
 

Example

routes
    auth.js
    main.js
    404.js
    config.json
 
var dirrequire = require('dirrequire');
 
dirrequire(__dirname + "/routes", function(err, routes) {
    console.log(routes);
});