8000 GitHub - huuyafwww/has-command: Check if a binary exists in your system PATH.
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

huuyafwww/has-command

Repository files navigation

has-command

MIT License

Check if a binary exists in your system PATH.

Features

  • Fully compatible with TypeScript.
  • Supports both ESM (ES Modules) and CommonJS module systems.

Installation

Replace and execute the command according to the package manager you are using. Here is an example of npm.

npm install --save-dev has-command

Examples

ES modules

import { hasCommand } from 'has-command';

console.log(await hasCommand('cd')); // true
console.log(await hasCommand('nonexistent_command')); // false

CommonJS

const { hasCommand } = require('has-command');

console.log(await hasCommand('cd')); // true
console.log(await hasCommand('nonexistent_command')); // false

License

MIT

About

Check if a binary exists in your system PATH.

Resources

License

Stars

Watchers

Forks

Packages

No packages published
0