npm.io
2.0.2 • Published 7 years ago

is-command

Licence
MIT
Version
2.0.2
Deps
0
Size
4 kB
Vulns
0
Weekly
0

is-command

Npm Package Travis CI Status

Check if a CLI command is available whithin the current working directory.

Installation

npm install is-command

Usage

const isCommand = require('is-command');

isCommand('aCommand')
  .then((is) => {
    if (!is) {
      // aCommand does not exists. Do something about it…
    }
  });

});

or:

import commandExists from 'is-command';

const is = await isCommand('aCommand')

if (!is) {
  // aCommand does not exists. Do something about it…
}

Keywords