Needs
Require multiple modules in node.js.
Installation
$ npm install needs --save
Usage
RegExp pattern
var needs = require('needs');
needs(__dirname, 'controllers', {
includes: /(.+Controller)\.js$/,
excludes: /^\.(git|svn)$/
});
Minimatch string pattern
needs(__dirname, 'controllers', {
includes: '+(*.js|*.json)',
excludes: '+(*.git|*.svn)'
});
Array includes and excludes
needs(__dirname, 'controllers', {
includes: ['*.js', '*.json'],
excludes: ['*.git', '*.svn']
});
Array pattern
needs(__dirname, 'controllers', ['*.js', '*.json']);
Simplest way to include and exclude
needs(__dirname, 'controllers', ['*.js', '*.json', '!*.git', '!*.svn']);
needs(__dirname, 'controllers');
Links
License
Copyright (c) 2014 Tao Yuan
Licensed under the MIT license.