# @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.
Usage
// The Program instance generated for you
import program from "@caporal/core"
program
.command(...)
.action(...)
[...]
# 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.
Usage
import { parseArgv } from "@caporal/core"
const {args, options} = parseArgv({
// ... options
})
Checkout parseArgv()
documentation here.
# chalk
chalk
npm module re-export
Usage
import { program, chalk } from "caporal"
program
.command('pay')
.argument('<amount>', 'Amount to pay', Validator.NUMBER)
.action(({logger, args}) => {
logger.info("You paid $%s", chalk.red(args.amount))
})
[...]
Command →