Packages

cac

7.1.1 · 20 Nov 2026MIT73.1M / weekRepositoryHomepagenpmAtom feed

Your version

6.0.0

major25 Nov 2018Where it was published

6.7.14 is the newest release of 6.x.

In short

3 breaking

  • Breaking

    Many breaking changes, so it's a new major release.

  • Breaking

    Unknown options are not allowed by default.

  • Breaking

    --help and --version are not added by default.

Release note

Many breaking changes, so it's a new major release. But you don't need to upgrade to v6 if it's unnecessary for you :P

New Features

Support brackets in arguments

i.e. it works like commander.js now:

const cli = require('cac')()

cli.command('build <entry> [...more]')
.option('--target [target]', 'Build target', { default: 'web' })
.action((entry, more, options) => {
	console.log(entry, more, options)
})

cli.parse()

Options now can be used before command

node cli.js build --minimize
# equals to
node cli.js --minimize build

Smaller size

13kB in total, compiled file is about 400 SLOC, only one single tiny dependency.

More

Check out README

Notable Breaking Changes

  • Breaking

    Unknown options are not allowed by default.

  • Breaking

    --help and --version are not added by default.

A whole project to check? Paste its package.json in the dependency check: every deprecated, outdated or vulnerable dependency, with what to upgrade to. Free, no account.