node environment variables

node and sometimes need to get the environment variables, you can use built-in objects process node to achieve,

For example: the value of environment variable name Get GRUNT_PATH of:
var = gruntPath process.env.GRUNT_PATH;
may also acquire the current project relative to the path gruntPath;
var = path.relative NodePath (__ dirname, process.env.GRUNT_PATH);

Guess you like

Origin blog.51cto.com/13496570/2402127