Thanks to visit codestin.com
Credit goes to Github.com

Skip to content

eddywashere/pets

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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 [email protected]: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

About

An example cli built with yargs

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published