JamesEggers1/node-requiredir — pull request #3 by jpoehls (2012-07-12 04:19:50+00:00)
Title: Resolve the require path relative to the parent module's directory.

Currently requiredir resolves paths relative to `process.cwd()`. This is not always the expected behavior.

I would expect to be able to pass a path that is relative to the current script's directory, which is consistent with how `require()` works.

For example, given the following structure:

```
/app
/routes
/api
/people.js
/index.js

/server.js
```

Calling `requiredir('./api')` from `./routes/index.js` would try to import all files from `/app/api`.

This pull request fixes it so that it would correctly import from `/app/routes/api`.