Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/npm/cli.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/doc
diff options
context:
space:
mode:
authorMat Warger <mwarger@gmail.com>2018-08-07 23:33:39 +0300
committerKat Marchán <kzm@zkat.tech>2018-08-07 23:33:39 +0300
commite2346e7702acccefe6d711168c2b0e0e272e194a (patch)
tree605ba363ec02aa28dc5640841370b9b2b4c9d97b /doc
parentd8114618137bb5b9a52a86711bb8dc18bfc8e60c (diff)
docs: added a section for usage with process.env (#14)
added a header for usage with process.env to separate section from 'current lifecycle event' and make it easier to find PR-URL: https://github.com/npm/cli/pull/14 Credit: @mwarger Reviewed-By: @zkat
Diffstat (limited to 'doc')
-rw-r--r--doc/misc/npm-scripts.md4
1 files changed, 3 insertions, 1 deletions
diff --git a/doc/misc/npm-scripts.md b/doc/misc/npm-scripts.md
index 259bf28a6..e4b90096a 100644
--- a/doc/misc/npm-scripts.md
+++ b/doc/misc/npm-scripts.md
@@ -143,7 +143,9 @@ The package.json fields are tacked onto the `npm_package_` prefix. So,
for instance, if you had `{"name":"foo", "version":"1.2.5"}` in your
package.json file, then your package scripts would have the
`npm_package_name` environment variable set to "foo", and the
-`npm_package_version` set to "1.2.5"
+`npm_package_version` set to "1.2.5". You can access these variables
+in your code with `process.env.npm_package_name` and
+`process.env.npm_package_version`, and so on for other fields.
### configuration