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

2.0 KiB

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 ;)