npm / command-line-args
command-line-args
What changed in command-line-args 5 to 6, from its official release notes, upgrade guides and advisories. Sources checked 2026-10-28.
3 breaking6 new APIs and options1 behavior and defaults2 fixes and other
See which of these apply to your code, ranked, in your agent:
npx @unstale/cli initcommand-line-args 62 changes
Breaking changes 1
Support for Node versions less than v12.20 was dropped; users of older versions should stay on v5.2.1.
Behavior and default changes 1
The package is now a native ES6 module while continuing to support CommonJS.
command-line-args 510 changes
Breaking changes 2
Setting a singular, non-multiple option more than once now throws an ALREADY_SET exception.
Unknown values now throw UNKNOWN_VALUE by default, so all options and values must be accounted for in the option definitions. Use partial or stopAtFirstUnknown to disable strict-by-default behaviour.
New APIs and options 6
The ALREADY_SET exception now has an optionName property containing the option name that has already been set.
Adds camelCase as a parse feature.
Adds stopAtFirstUnknown as a parse option; it can also disable strict-by-default behaviour.
Adds lazyMultiple as an option definition feature.
The UNKNOWN_OPTION exception now has an optionName property containing the argument that specified the unknown option.
The UNKNOWN_VALUE exception now has a value property containing the unknown value.
Fixes and other changes 2
Fixes an unknown --option=value notation value being consumed as defaultOption.
Fixes an unknown --option=value argument being split when defaultOption is set.