-
Notifications
You must be signed in to change notification settings - Fork 29.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature request: Env Var NODE_REQUIRE #11853
Comments
Seems like preloading multiple modules via environment variable might be a bit of a pain if the list delimiter was part of a file path to a local module. For example, |
I think that |
You can preload multiple modules by passing multiple |
ok. I'd go with checking |
or go with the convention use for |
Yea, I suppose using |
Adds a new feature that checks the environment variable NODE_REQUIRE that should be a : (or ; on windows) delimited string of modules to preload, the same as those that can be specified by the -r command line option. Implements: nodejs#11853
Adds a new feature that checks the environment variable NODE_PRELOAD that should be a : (or ; on windows) delimited string of modules inside the global node_modules dir to preload, the same as those that can be specified by the -r command line option except this is limited to global node_modules. Each module can be the absolute path of the module or just the name of the module under the global node_modules dir. Implements: nodejs#11853
Adds a new feature that checks .node_preloadrc for a list of modules to preload. One module per line and each one can be the absolute path or just the name of the module. Two locations will be check for the rc file: HOMEDIR or CWD. The one in HOMEDIR must specify modules under the global node_modules dir only, and the one in CWD must specify modules under the dir CWD/node_modules only. This is smilar to what can be specified by the -r command line option except the modules are limited to the global or local node_modules only. This feature must be opted-in with setting the env var NODE_PRELOADRC_ENABLE to a non-falsy value. Implements: nodejs#11853
closing, conversation moved to #11997 |
I am requesting for something that's basically the command line option
-r
but through an environment variableNODE_REQUIRE
. The reason is that the-r
option is not persistent. If some other app invokes node, then the-r
is not applied. The environment variableNODE_REQUIRE
should always be checked when node starts up.When the env var exist and
-r
is also specified, I think both should be required.Thanks.
The text was updated successfully, but these errors were encountered: