# @caporal/core

Main Caporal module.

# program

This represents your program. You don't have to instanciate the Program class, it's already done for you.


// The Program instance generated for you
import program from "@caporal/core"


# parseArgv()

This is the command line parser internaly used by Caporal.

Advanced usage

Usually, you won't need to use the parser directly, but if you just want to parse some args without all capabilities brought by Caporal, feel free to play with it.


import { parseArgv } from "@caporal/core"

const {args, options} = parseArgv({
 // ... options

Checkout parseArgv() documentation here.

# chalk

chalk npm module re-export


import { program, chalk } from "caporal"

 .argument('<amount>', 'Amount to pay', Validator.NUMBER)
 .action(({logger, args}) => {
   logger.info("You paid $%s", chalk.red(args.amount))