In Windows 7 you can find the location path for the variables in the following location.
- Click the
Start button
and right-click thecomputer
option in thestart menu
, and selectProperties
. - Click the
Advanced System Settings
link in the left column. - In the
System Properties
window, click on theAdvanced
tab, then click theEnvironment Variables
button near the bottom of the window (pictured above). - You find the
Environment Variables
window (pictured below)
Variable | Description |
---|---|
%PATH% | Semicolon delimited list of directories |
%HOMEDIR% | The path to the home directory |
Remember: Environment variables can have scope and a value, just like any other variable.
Variable Assignment
When writing your application you might want to set or read an environment variable. One of the most common custom variables used in ExpressJS is the NODE_ENV
variable. This is a custom variable that is used to distinguish between production and development environments.
Setting a variable: To set the variable use the command line.
set NODE_ENV=production
Reading a variable: To read the variable using the command line.
ECHO %NODE_ENV%
Reading a variable: To read the variable using JavaScript.
console.log(process.env.NODE_ENV);
Summary
Remember it’s your personal development environment, it needs to be as unique as you. You will be using it hours on end, if you decide to use windows great, if you go with linux great, or OSX then great.
I always had a passion for the field of STEM (Science, Technology, Engineering, and Math) and I knew I wanted to do something to make a difference in the world. I just didn’t know where to start. I was an immigrant in a new country, grew up in a tough environment, and wasn’t sure how… Read More