Skip to content

v4.0.0

Compare
Choose a tag to compare
@75lb 75lb released this 31 Jan 21:50
· 110 commits to master since this release

Breaking changes since v3.0.5

  • Removed support for node versions less than v4.0.0

  • The method signature changed. If you're passing a custom argv you now do it this way:

    const argv = [ '--log-level', 'info' ]
    commandLineArgs(optionDefinitions, { argv })

    Previously, it was done this way:

    const argv = [ '--log-level', 'info' ]
    commandLineArgs(optionDefinitions, argv)
  • String is the new default type function.

If all the following are true then no changes are required to your code

  • Your app does not need to run on old nodejs versions
  • You don't pass a custom argv
  • All your option definitions have a type specified

New feature

  • Partial parsing - support for unknown options. See the docs and issue 25 for background.

Other changes

  • Fixed #24, #39
  • Overhauled the examples
  • Refactored internals
  • More tests added