JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 4483653
  • Score
    100M100P100Q237744F
  • License MIT

check whether a command line command exists in the current environment

Package Exports

  • command-exists

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (command-exists) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

command-exists

node module to check if a command-line command exists

installation

npm install command-exists

usage

async

var commandExists = require('command-exists');

commandExists('ls', function(err, commandExists) {

    if(commandExists) {
        // proceed confidently knowing this command is available
    }

});

sync

var commandExistsSync = require('command-exists').sync;
// returns true/false; doesn't throw
if (commandExistsSync('ls')) {
    // proceed
} else {
    // ...
}