Home
Docs
GitHub
Pricing
Blog
Log In

Run Sandworm Audit for your App

Get started
Hold on, we're currently generating a fresh version of this report
Generated on May 25, 2024 via pnpm

command-exists 1.2.9

check whether a command line command exists in the current environment
Package summary
Share
0
issues
1
license
1
MIT
Package created
21 Sep 2014
Version published
15 Apr 2020
Maintainers
1
Total deps
1
Direct deps
0
License
MIT

Issues

0
This package has no issues

Licenses

MIT License

Permissive
OSI Approved
This is a human-readable summary of (and not a substitute for) the license. Disclaimer.
Can
commercial-use
modify
distribute
sublicense
private-use
Cannot
hold-liable
Must
include-copyright
include-license
1 Packages, Including:
command-exists@1.2.9
Disclaimer

This deed highlights only some of the key features and terms of the actual license. It is not a license and has no legal value. You should carefully review all of the terms and conditions of the actual license before using the licensed material.

Sandworm is not a law firm and does not provide legal services. Distributing, displaying, or linking to this deed or the license that it summarizes does not create a lawyer-client or any other relationship.

Direct Dependencies

0
All Dependencies CSV
β“˜ This is a list of command-exists 's direct dependencies. Data on all dependencies, including transitive ones, is available via CSV download.
NameVersionSizeLicenseTypeVulnerabilities

Visualizations

Frequently Asked Questions

What does command-exists do?

Command-exists is a handy Node.js module whose primary function is to check if a particular command-line command exists in the current environment. This feature allows your Node.js applications to perform certain actions or change the flow of execution based on the availability of certain command-line tools.

How do you use command-exists?

You can install command-exists using npm:

npm install command-exists

You can then use it in three ways:

  • Async mode: Invoking the commandExists function with a command and a callback function. The callback will be called with err and commandExists arguments, the latter being a boolean indicating the existence of the command.

    var commandExists = require('command-exists');
    commandExists('ls', function(err, commandExists) {
        if(commandExists) {
            // proceed confidently knowing this command is available
        }
    });
    
  • Promise mode: If commandExists is invoked without a callback, it returns a promise that will be resolved with the command if exists, or rejected if it doesn't.

    var commandExists = require('command-exists');
    commandExists('ls')
    .then(function(command){
        // proceed
    }).catch(function(){
        // command doesn't exist
    });
    
  • Sync mode: The commandExistsSync function synchronously checks the existence of a command and returns a boolean value.

    var commandExistsSync = require('command-exists').sync;
    if (commandExistsSync('ls')) {
        // proceed
    } else {
        // ...
    }
    

Where are the command-exists docs?

The most up-to-date and detailed documentation for command-exists can be found in the README file on its GitHub repository at the URL: https://github.com/mathisonian/command-exists. This readme file includes installation instructions, usage examples for all supported modes, and a chronological changelog with changes made in each version of the package.