joyent/node — Issue #2053: Use require.resolve() with additional paths (replacement for require.paths)
Author: akidee
Created: 2011-11-08 22:37:50+00:00
State: open

Obviously, before 0.6 there was a reason to have require.paths. It was clear that it is a problematic API, but what about adding an optional "additional paths" parameter to require.resolve()? I use a module to clientize modules, and I need a way to resolve modules with additonal paths to emulate other contexts. Example:

```js
var paths = [ 'ownPath' ].concat(module.paths)
require.resolve('moduleId', paths)
```

It seems that require.paths was just replaced by module.paths ?