Permalink
Browse files

Adds defaults to index.js

  • Loading branch information...
1 parent 75a2d31 commit 76deeb3ece03540a744c7e26a767ba70605ee1f6 @dscape dscape committed Aug 14, 2013
Showing with 8 additions and 0 deletions.
  1. +8 −0 index.js
View
@@ -1,6 +1,14 @@
var fs = require('fs');
module.exports = function requireAll(options) {
+ if (typeof options === 'string') {
+ options = {
+ dirname: options,
+ filter: /(.+)\.js(on)?$/,
+ excludeDirs: /^\.(git|svn)$/
+ };
+ }
+
var files = fs.readdirSync(options.dirname);
var modules = {};

0 comments on commit 76deeb3

Please sign in to comment.