Skip to content

Commit

Permalink
doc: document process.env better
Browse files Browse the repository at this point in the history
Fixes nodejs#6424.

Reviewed-By: Fedor Indutny <[email protected]>
  • Loading branch information
mmalecki authored and indutny committed Sep 15, 2014
1 parent 7c5fabe commit 0664ddc
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions doc/api/process.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -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])

Expand Down

0 comments on commit 0664ddc

Please sign in to comment.