shell-env
Get environment variables from the shell
Especially useful for Electron/NW.js apps as GUI apps on OS X doesn't inherit the environment variables defined in your dotfiles (.bashrc/.bash_profile/.zshrc/etc).
Install
$ npm install --save shell-env
Usage
const shellEnv = require('shell-env');
console.log(shellEnv.sync());
API
shellEnv()
Return a promise for the environment variables.
shellEnv.sync()
Returns the the environment variables.
Related
- shell-path - Get the $PATH from the shell
- fix-path - Fix the $PATH on OS X when run from a GUI app
- shell-history - Get the command history of the user's shell
License
MIT © Sindre Sorhus