Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -26,3 +26,6 @@ node_modules

# Users Environment Variables
.lock-wscript

#Intellij
.idea/
4 changes: 3 additions & 1 deletion .jshintrc
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,7 @@
"unused": true,
"boss": true,
"eqnull": true,
"node": true
"node": true,
"mocha": true,
"esversion": 6
}
8 changes: 6 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
language: node_js
node_js:
- "4"
- "6"
- "12"
- "13"
- "14"
- "15"
- "16"
- "17"
25 changes: 13 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ command-exists

node module to check if a command-line command exists


**supported Node Versions**: 12+

## installation

Expand All @@ -16,32 +16,35 @@ npm install command-exists
### async

```js
var commandExists = require('command-exists');
const commandExists = require('command-exists');

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

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

});
```

### promise

```js
var commandExists = require('command-exists');
const commandExists = require('command-exists');

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

### sync

```js
var commandExistsSync = require('command-exists').sync;
const commandExistsSync = require('command-exists').sync;
// returns true/false; doesn't throw
if (commandExistsSync('ls')) {
// proceed
Expand All @@ -51,10 +54,8 @@ if (commandExistsSync('ls')) {

```


## changelog


### v1.2.9

Fix issue with absolute paths on Windows ([#24](https://github.com/mathisonian/command-exists/pull/24))
Expand All @@ -65,7 +66,7 @@ Fix issue with paths on Windows ([#21](https://github.com/mathisonian/command-ex

### v1.2.7

Removes unnecessary printed output on windows.
Removes unnecessary printed output on Windows.

### v1.2.6

Expand Down
13 changes: 7 additions & 6 deletions appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,12 @@ matrix:

environment:
matrix:
- nodejs_version: "4"
- nodejs_version: "6"
- nodejs_version: "7"
- nodejs_version: "8"
- nodejs_version: "9"
- nodejs_version: "12"
- nodejs_version: "13"
- nodejs_version: "14"
- nodejs_version: "15"
- nodejs_version: "16"
- nodejs_version: "17"

install:
# install modules
Expand All @@ -28,4 +29,4 @@ test_script:
- npm run test

# Don't actually build.
build: off
build: off
Loading