troygoode/node-require-directory — pull request #12 by briandela (2014-07-28 19:00:53+00:00)
Title: Make Path parameter relative to __dirname and not the root of the app

Currently, the second path parameter is relative to the root of the application, and not relative to the current __dirname. Not sure if the current behaviour is the desired behaviour but I wanted to submit a pull request.

For example, with a directory structure like the following (where this is located in `/Users/myuser/sites/myapp`):

* /app.js
* /server/routes/index.js
* /server/controllers/index.js

If in `server/routes/index.js` I was to do:
```js
var controllers = requireDirectory(module, '../controllers')
```
the path would resolve to `/Users/myuser/sites/controllers`. I would have expected it to resolve relative to the directory of the current module (i.e. relative to `path.dirname(m.filename)`) which would have made it `/Users/myuser/sites/myapp/server/controllers`

For now I am doing this to get the desired behaviour:

```js
var controllers = requireDirectory(module, __dirname + '/../controllers');
```

I will gladly submit a pull request