Nonstop Progressive Marxism
Unleash awesomeness. Private packages, team management tools, and powerful integrations. Get started with npm Orgs »

shell-path

2.1.0 • Public • Published

shell-path Build Status

Get the $PATH from the shell

Useful for Electron/NW.js apps as GUI apps on macOS doesn't inherit the $PATH defined in your dotfiles (.bashrc/.bash_profile/.zshrc/etc).

Install

$ npm install --save shell-path

Usage

When executed from a GUI app on macOS:

const shellPath = require('shell-path');
 
console.log(process.env.PATH);
//=> '/usr/bin'
 
console.log(shellPath.sync());
//=> '/usr/local/bin:/usr/bin:...'

API

shellPath()

Return a promise for the $PATH.

shellPath.sync()

Returns the $PATH.

Related

  • fix-path - Fix the $PATH on macOS when run from a GUI app
  • shell-env - Get environment variables from the shell
  • shell-history - Get the command history of the user's shell

License

MIT © Sindre Sorhus

install

npm i shell-path

Downloadsweekly downloads

4,969

version

2.1.0

license

MIT

homepage

github.com

repository

Gitgithub

last publish

collaborators

  • avatar
  • avatar
Report a vulnerability