Skip to content

Files

Latest commit

 

History

History
33 lines (23 loc) · 265 Bytes

set-env-when-running.md

File metadata and controls

33 lines (23 loc) · 265 Bytes

Set Environment Variable When Running App

app.js

console.log(
	process.env.FOO
);

Output

$ node app
undefined

$ FOO=BAR node app
BAR

$ node app
undefined

$ export FOO=BAR; node app
BAR

$ node app
BAR

# reset

$ node app
undefined