• Skip to main content
  • Skip to primary sidebar

Founder at work

Master the skills to create and launch your next SaaS company

  • About Me
  • Reviews
  • Resources
  • Community
  • Contact
  • Lessons
  • Series
  • Search
  • Login

How to setup OS X EL Capitan Environment Variables (Create, Read, Update, Delete)

January 21, 2016 by Rick Hernandez Leave a Comment

Variable Location

OSX The default location for custom environmental variables in OSX the .bash_profile file.

~/.bash_profile

To list all the variables that are being used by your system use the printenv command.

➜ ~ printenv
Variable Description
$PATH Semicolon delimited list of directories
$HOME 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.

export NODE_ENV=development

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.

Rick Hernandez

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

Share this:

  • Click to share on Twitter (Opens in new window)
  • Click to share on Facebook (Opens in new window)

Related

Filed Under: JSecademy

Primary Sidebar

Learn How To Take Your Idea And Convert It Into An App From Scratch Even If You Have Never Written A Single Line Of Code.

  • How to Find Your Next Great App Idea
  • The Secret To Getting PAID To Build Your Own App
  • How To Create Your App (SaaS, Mobile, VR, AR, Game)
  • How To Monetize Your Apps
Learn More
4.82 Ratings

Copyright © 2025 · JSecademy Blog Theme on Genesis Framework · WordPress · Log in