Skip to content

letpath/shell-path

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

30 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

shell-path Build Status

Get the $PATH from the shell

Useful for Electron/NW.js apps as GUI apps on OS X 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 OS X:

const shellPath = require('shell-path');

console.log(process.env.PATH);
//=> '/usr/bin'

console.log(shellPath.sync());
//=> '/usr/local/bin:/usr/bin:...'

API

shellPath(callback(error, path))

shellPath.sync()

Synchronous version. Returns the $PATH.

Related

  • fix-path - Fix the $PATH on OS X when run from a GUI app

License

MIT © Sindre Sorhus

About

Get the $PATH from the shell

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • JavaScript 100.0%