dotfiles/vscode/.vscode/extensions/matangover.mypy-0.3.1/node_modules/lookpath
Errol Sancaktar 5f8db31398 alacritty
2024-07-15 17:06:13 -06:00
..
bin alacritty 2024-07-15 17:06:13 -06:00
lib alacritty 2024-07-15 17:06:13 -06:00
src alacritty 2024-07-15 17:06:13 -06:00
LICENSE alacritty 2024-07-15 17:06:13 -06:00
package.json alacritty 2024-07-15 17:06:13 -06:00
README.md alacritty 2024-07-15 17:06:13 -06:00

lookpath

npm version npm download Node.js CI codecov Maintainability

To check if the command exists and where the executable file is.

const { lookpath } = require('lookpath');

const p = await lookpath('bash');
// "/bin/bash", otherwise "undefined"

Install

npm install lookpath

Background

Options

const { lookpath } = require('lookpath');

const p = await lookpath('bash', { include: ['/home/hiromu/.bin'], exclude: ['/mnt'] });
// include: Do scan also under `~/.bin`
// exclude: Do not scan under `/mnt`

Issues

Any feedback would be appreciated ;)