joyent/node — Issue #2234: modify module include path dynamically
Author: inazar
Created: 2011-11-30 19:14:21+00:00
State: open

In versions before 0.6 setting require.path dynamically changed the module search path

After 0.6 setting process.env.NODE_PATH dynamically changes environment variable (as intended) but does not influence the paths used by module.js to load modules (require.path did this).

If my application based on config uses different custom modules I'd like to add path to them dynamically.

As solution can suggest to either make NODE_PATH setter to re-init module paths with module._initPaths() OR make _initPaths() method public.