pets

0.1.0 • Public • Published

pets

An example cli built with yargs.

Install

pets requires Node V5 or higher. To install, run:

npm install -g pets

or clone the package locally and npm link it.

git clone git@github.com:eddywashere/pets.git
cd pets
npm install
npm link

CLI Usage

pets <command> <subcommand> [--parameters]

Parameters can also be passed in via environment variables prefixed with PETS_CONFIG.

Example:

PETS_CONFIG_NAMES="nymeria,tyrion" pets cats add
# equivalent to:
# pets cats add --names nymeria,tyrion

Code Organization

Commands are organized in subdirectories within the cmd directory. Each subcommand is read from the subdirectories via .commandDir. See yargs commandDir docs for more info.

In a real world example, the handler for individual subcommands would contain real business logic to process the inputs.

TODO

Tests

Readme

Keywords

none

Package Sidebar

Install

npm i pets

Weekly Downloads

1

Version

0.1.0

License

MIT

Last publish

Collaborators

  • eddywashere