diff options
author | Maciej MaĆecki <me@mmalecki.com> | 2013-11-11 20:51:34 +0100 |
---|---|---|
committer | Fedor Indutny <fedor@indutny.com> | 2014-09-16 02:41:38 +0400 |
commit | 0664ddc093961d771b22fafae4f38b0f38140ebf (patch) | |
tree | 1ed0c65a2f02222c8c559a6c46d9278bedb94a5d | |
parent | 7c5fabe4053c82806b0a22437bceab8aa7465b78 (diff) | |
download | nodejs-0664ddc093961d771b22fafae4f38b0f38140ebf.tar.gz nodejs-0664ddc093961d771b22fafae4f38b0f38140ebf.tar.bz2 nodejs-0664ddc093961d771b22fafae4f38b0f38140ebf.zip |
doc: document `process.env` better
Fixes #6424.
Reviewed-By: Fedor Indutny <fedor@indutny.com>
-rw-r--r-- | doc/api/process.markdown | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/doc/api/process.markdown b/doc/api/process.markdown index 68f15c2fb..04da4a6f8 100644 --- a/doc/api/process.markdown +++ b/doc/api/process.markdown @@ -276,6 +276,29 @@ Returns the current working directory of the process. An object containing the user environment. See environ(7). +An example of this object looks like: + + { TERM: 'xterm-256color', + SHELL: '/usr/local/bin/bash', + USER: 'maciej', + PATH: '~/.bin/:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin', + PWD: '/Users/maciej', + EDITOR: 'vim', + SHLVL: '1', + HOME: '/Users/maciej', + LOGNAME: 'maciej', + _: '/usr/local/bin/node' } + +You can write to this object, but changes won't be reflected outside of your +process. That means that the following won't work: + + node -e 'process.env.foo = "bar"' && echo $foo + +But this will: + + process.env.foo = 'bar'; + console.log(process.env.foo); + ## process.exit([code]) |