node module to check if a command-line command exists
npm install command-existsvarcommandExists=require('command-exists');commandExists('ls',function(err,commandExists){if(commandExists){// proceed confidently knowing this command is available}});varcommandExists=require('command-exists');// invoked without a callback, it returns a promisecommandExists('ls').then(function(command){// proceed}).catch(function(){// command doesn't exist});varcommandExistsSync=require('command-exists').sync;// returns true/false; doesn't throwif(commandExistsSync('ls')){// proceed}else{// ...}Fix issue with absolute paths on Windows (#24)
Fix issue with paths on Windows (#21)
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