@simbo/find-bin
v1.0.2
Published
A lightweight utility to locate the executable path of a command.
Maintainers
Readme
Find Bin
A lightweight utility to locate the executable path of a command.
It searches for binaries in local node_modules/.bin directories first, and
falls back to globally available executables.
Features
Check if a command exists and resolve its path
Searches upward through
node_modules/.binfoldersFalls back to global executables via
whichAsync, Promise-based API
Fully typed with TypeScript
Installation
Install @simbo/find-bin from the npm registry:
npm i [-D] @simbo/find-binUsage
For a complete API reference, see the documentation.
Example
import { findBin } from '@simbo/find-bin';
const binPath = await findBin('eslint');
if (binPath) {
console.log(`Found eslint: ${binPath}`);
} else {
console.error('eslint not found.');
}