amis-rpc-design/node_modules/command-exists
2023-10-07 19:42:30 +08:00
..
lib v1.0.0 2023-10-07 19:42:30 +08:00
test v1.0.0 2023-10-07 19:42:30 +08:00
.jshintrc v1.0.0 2023-10-07 19:42:30 +08:00
.travis.yml v1.0.0 2023-10-07 19:42:30 +08:00
appveyor.yml v1.0.0 2023-10-07 19:42:30 +08:00
index.js v1.0.0 2023-10-07 19:42:30 +08:00
LICENSE v1.0.0 2023-10-07 19:42:30 +08:00
package.json v1.0.0 2023-10-07 19:42:30 +08:00
README.md v1.0.0 2023-10-07 19:42:30 +08:00

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
    }

});

promise

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

// invoked without a callback, it returns a promise
commandExists('ls')
.then(function(command){
    // proceed
}).catch(function(){
    // command doesn't exist
});

sync

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

changelog

v1.2.7

Removes unnecessary printed output on windows.

v1.2.6

Small bugfixes.

v1.2.5

Fix windows bug introduced in 1.2.4.

v1.2.4

Fix potential security issue.

v1.2.0

Add support for promises

v1.1.0

Add synchronous version

v1.0.2

Support for windows