Browse Source

doc: document `process.env` better

Fixes #6424.

Reviewed-By: Fedor Indutny <fedor@indutny.com>
v0.10.32-release
Maciej Małecki 11 years ago
committed by Fedor Indutny
parent
commit
0664ddc093
  1. 23
      doc/api/process.markdown

23
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])

Loading…
Cancel
Save