From fba8524b3907a8113880e16aaf197b2e5eaef2d9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?La=C3=A9rcio=20Silva?= Date: Mon, 28 Oct 2019 23:28:41 -0300 Subject: [PATCH] Add how get evironment variable --- JavaScript_Advance/get_environment_variable.js | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 JavaScript_Advance/get_environment_variable.js diff --git a/JavaScript_Advance/get_environment_variable.js b/JavaScript_Advance/get_environment_variable.js new file mode 100644 index 0000000..59e5783 --- /dev/null +++ b/JavaScript_Advance/get_environment_variable.js @@ -0,0 +1,7 @@ +// Getting values of environment variables +// For example, getting username of machine +const ENV_VARIABLE_KEY = "USER"; + +const ENV_VARIABLE_VALUE = process.env[ENV_VARIABLE_KEY]; + +console.log(ENV_VARIABLE_VALUE); \ No newline at end of file