Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

argh-matey

3rd-Eden13MIT1.0.0

Argh Matey allows you to easily find the right cli command using language processing

argh, matey, cli, learning

readme

argh-matey

Argh matey is a helps you finding the correct CLI command when your users are submitting jibberish, and you're just trying to understand what on earth they mean.

Installation

The package is published in the public npm registry and can be installed by running:

npm install --save argh-matey

Usage

const matey = require('argh-matey');

We return a single function, matey, that accepts the following arguments:

  • argh, Array, Array of actual commands a user could have submitted.
  • jibberish, String, The actual received command.

The function will either return null or a the command that matches:

matey(['test', 'register', 'publish'], 'tst'); // 'test'
matey(['test', 'register', 'publish'], 'what'); // null
matey(['test', 'register', 'publish'], 'TESS'); // 'test'

License

MIT