Skip to content

Upgrading commander 10 to 11

Breaking10.0.1 → 11.1.0Platform1Deprecated1New4Changed2Fixed5Other1

BreakingUpgrade verdict

A platform requirement change.

  • You need Node.js version 16 or newer to use this version of Commander.
  • The private argument list is now officially available as `registeredArguments`.
2 items need code or config changes

Node.js requirement changed in 11.0.0: >=14 → >=16.

Platform1
Commander 11 requires Node.js v16 or higher.
Deprecated1
Command._args was private anyway, but now available as registeredArguments.
Command._argsCommand.registeredArguments

Generated by DepDelta from published .d.ts files. Not mixed with prose notes.

  • added: export * from './index'
  • changed: method Command.executableDir(): string → method Command.executableDir(): string | null
  • changed: method Command.option<T>(flags: string, description: string, fn: (value: string, previous: T) => T, defaultValue?: T): this → method Command.option<T>(flags: string, description: string, parseArg: (value: string, previous: T) => T, defaultValue?: T): this
  • changed: method Command.requiredOption<T>(flags: string, description: string, fn: (value: string, previous: T) => T, defaultValue?: T): this → method Command.requiredOption<T>(flags: string, description: string, parseArg: (value: string, previous: T) => T, defaultValue?: T): this
  • changed: type OptionValueSource = 'default' | 'config' | 'env' | 'cli' | 'implied' → type OptionValueSource = LiteralUnion<'default' | 'config' | 'env' | 'cli' | 'implied', string> | undefined
  • added: method Command.version(): string | undefined
  • added: property Argument.argChoices?: string[]
  • added: property Argument.defaultValue?: any
  • added: property Argument.defaultValueDescription?: string
  • added: property Option.envVar?: string
  • added: property Option.presetArg?: unknown
  • added: readonly property Command.registeredArguments: readonly Argument[]