Skip to content
fregantePublic

About

Find the folder of a global command (installed via npm or not)

Resources

Stars

1 star

Watchers

1 watching

Forks

Latest commit

 

History

21 Commits

Folders and files

Repository files navigation

bin-dir

Find the folder of a global command (installed via npm or not)

This is essentially a cross-os command for which + realpath + dirname plus special support for npm modules.

"Special support" means that bin-dir eslint won't open the directory .../eslint/bin but .../eslint

Install

npm install --global bin-dir

CLI

$ bin-dir npm
/usr/local/lib/node_modules/npm

$ bin-dir wget
/usr/local/Cellar/wget/1.18/bin

$ bin-dir unicorns
// no output

API

const binDir = require('bin-dir');

binDir('xo') === '/usr/local/lib/node_modules/xo';
binDir('brew') === '/usr/local/bin';
binDir('unicorns') === undefined;

License

MIT © Federico Brigante

About

Find the folder of a global command (installed via npm or not)

Resources

Stars

1 star

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages