diff options
-rw-r--r-- | doc/scripts.md | 8 | ||||
-rw-r--r-- | man1/scripts.1 | 5 |
2 files changed, 13 insertions, 0 deletions
diff --git a/doc/scripts.md b/doc/scripts.md index d215abcb7..7cf34405e 100644 --- a/doc/scripts.md +++ b/doc/scripts.md @@ -62,6 +62,14 @@ Configuration parameters are put in the environment with the `npm_config_` prefix. For instance, you can view the effective `root` config by checking the `npm_config_root` environment variable. +### dependency path and versions + +All of the resolved dependencies are available in the environtment as +`npm_dependency_<name>=<version>` and +`npm_dependency_<name>_path=<dir>`. So, if you need to refer to files +from dependency packages, or see which version is installed, you can +refer to those environment variables. + ### Special: package.json "config" hash The package.json "config" keys are overwritten in the environment if diff --git a/man1/scripts.1 b/man1/scripts.1 index bf2dd76f6..33b12a9ab 100644 --- a/man1/scripts.1 +++ b/man1/scripts.1 @@ -95,6 +95,11 @@ variable set to "foo", and the \fBnpm_package_version\fR set to "1\.2\.5" Configuration parameters are put in the environment with the \fBnpm_config_\fR prefix\. For instance, you can view the effective \fBroot\fR config by checking the \fBnpm_config_root\fR environment variable\. . +.SS "dependency path and versions" +All of the resolved dependencies are available in the environtment as \fBnpm_dependency_<name>=<version>\fR and \fBnpm_dependency_<name>_path=<dir>\fR\|\. So, if you need to refer to files +from dependency packages, or see which version is installed, you can +refer to those environment variables\. +. .SS "Special: package\.json "config" hash" The package\.json "config" keys are overwritten in the environment if there is a config param of \fB<name>[@<version>]:<key>\fR\|\. For example, if |