diff options
author | Mat Warger <mwarger@gmail.com> | 2018-08-07 23:33:39 +0300 |
---|---|---|
committer | Kat Marchán <kzm@zkat.tech> | 2018-08-07 23:33:39 +0300 |
commit | e2346e7702acccefe6d711168c2b0e0e272e194a (patch) | |
tree | 605ba363ec02aa28dc5640841370b9b2b4c9d97b /doc | |
parent | d8114618137bb5b9a52a86711bb8dc18bfc8e60c (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.md | 4 |
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 |