|
пре 2 година | |
---|---|---|
.. | ||
lib | пре 2 година | |
test | пре 2 година | |
.jshintrc | пре 2 година | |
.travis.yml | пре 2 година | |
LICENSE | пре 2 година | |
README.md | пре 2 година | |
appveyor.yml | пре 2 година | |
index.js | пре 2 година | |
package.json | пре 2 година |
node module to check if a command-line command exists
npm install command-exists
var commandExists = require('command-exists');
commandExists('ls', function(err, commandExists) {
if(commandExists) {
// proceed confidently knowing this command is available
}
});
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
});
var commandExistsSync = require('command-exists').sync;
// returns true/false; doesn't throw
if (commandExistsSync('ls')) {
// proceed
} else {
// ...
}
Removes unnecessary printed output on windows.
Small bugfixes.
Fix windows bug introduced in 1.2.4.
Fix potential security issue.
Add support for promises
Add synchronous version
Support for windows