|
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