autoric/express-train — pull request #33 by creynders (2014-02-11 10:05:29+00:00)
Title: Add non-default, optional recursion limit

I added the option to limit the recursion when traversing the directories for auto injection. This allows you to have subdirectories which aren't automatically traversed, e.g.

```javascript
var app = train(__dirname, {
middleware : {
path : 'middleware',
autoinject : true,
recurse : 1
}
});
```

Any middleware modules in a subdirectory of `middleware` won't be autoregistered. This is useful in a situation where you want to be able to register some of the modules explicitly (yet keep them nicely organized). For instance in my current project I want to register modules depending on `env` values: on 'staging' retrieve files from a remote service, but on production retrieve them from the file repository.

The `recurse` option can be configured to:
* `false`, `null`, any `int` less than 1: no recursion
* `true`, `undefined` (allows it to be default): unlimited recursion
* any `int` above 0: allows you to define the depth of recursion

Maybe `recurse` isn't the best name for this, though?