Skip to content

Commit e2346e7

Browse files
mwargerzkat
authored andcommitted
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: #14 Credit: @mwarger Reviewed-By: @zkat
1 parent d811461 commit e2346e7

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

Diff for: doc/misc/npm-scripts.md

+3-1
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,9 @@ The package.json fields are tacked onto the `npm_package_` prefix. So,
143143
for instance, if you had `{"name":"foo", "version":"1.2.5"}` in your
144144
package.json file, then your package scripts would have the
145145
`npm_package_name` environment variable set to "foo", and the
146-
`npm_package_version` set to "1.2.5"
146+
`npm_package_version` set to "1.2.5". You can access these variables
147+
in your code with `process.env.npm_package_name` and
148+
`process.env.npm_package_version`, and so on for other fields.
147149

148150
### configuration
149151

0 commit comments

Comments
 (0)