Skip to content
This repository was archived by the owner on Apr 22, 2023. It is now read-only.
This repository was archived by the owner on Apr 22, 2023. It is now read-only.

modify module include path dynamically #2234

@inazar

Description

@inazar

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.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions