Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

do4ng/animaux

Repository files navigation

Animaux

Javascript Library for CLI applications.

Feature

  • Type-hint

img

  • Command and option definition

Usage

Code

#!/usr/bin/env node
const { program } = require('animaux');
const app = new program('greeting').version('1.0.0');
app
 .command('hello <name>')
 .describe('Greets the user')
 .option('--greet', 'Greet message', 'Hello')
 .option('--from', 'From', 'Cat')
 .action(({ args, options }) => {
 console.log(`${options.from} says "${options.greet}, ${args.name}"`);
 });
app.parse(process.argv.slice(2));

Result

$ greeting hello John
Cat says "Hello, John"
$ greeting hello John --from Dog --greet=Yo
Dog says "Yo, John"

--help

$ greeting --help
Usage
 $ greeting [command] [options]
Commands
 hello Greets the user
Options (global)
Run '<command> --help' for more information on a command.
$ greeting build --help
Usage
 $ greeting hello <name>
Greets the user
Options (global)
Options (scoped)
 --greet Greet message (default: Hello)
 --from From (default: Cat)

License

MIT

About

Javascript Library for CLI applications.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

AltStyle によって変換されたページ (->オリジナル) /