Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I see the contents of process.env using bash?

Using the integrated Bash terminal in VS Code on Windows 10, I can access individual properties of the Node process.env object using echo $PROPERTYNAME, but I can't figure out how to list all of them.

$ process.env
bash: process.env: command not found
like image 597
Katie Fritz Avatar asked Jan 31 '18 22:01

Katie Fritz


2 Answers

Solved: start by typing node and pressing enter, then type process.env and press enter.

$ node
> process.env
{ ALLUSERSPROFILE: 'C:\\ProgramData',
  APPDATA: 'C:\\Users...,
  ...
}
like image 169
Katie Fritz Avatar answered Sep 19 '22 13:09

Katie Fritz


Pure node answer (on Linux at least)

node --print 'process.env'

{ LC_PAPER: 'es_AR.UTF-8', LESSKEY: '/etc/lesskey.bin', MANPATH: '/usr/local/man:/usr/share/man', NNTPSERVER: 'news', ... }

like image 39
LMC Avatar answered Sep 17 '22 13:09

LMC