command-line-usage

A simple, data-driven module for creating a usage guide.

MIT License

Downloads
7.4M
Stars
202
Committers
5
command-line-usage - v7.0.0 Latest Release

Published by 75lb over 1 year ago

This release freshens up the codebase and dependency tree. There are no functional changes to the API or behaviour.

Breaking changes since v6.1.3

  • Dropped support for node versions less than v12.20.

Non-breaking changes

  • Updated chalk so command-line-usage now works in deno. Fixes #40.

Non-functional changes

  • Updated codebase (including all examples) from CommonJS to ES Modules. A CJS build is included for backwards compatibility.
  • Added an example showing how to use table-layout in a content section, also updated the wiki docs
command-line-usage - v6.1.0

Published by 75lb almost 5 years ago

New feature since v6.0.2

In the list of option definitions passed to an optionList, the name property is no longer mandatory. Previously, the following example would have thrown validation errors due to the lack of name properties.

const commandLineUsage = require('command-line-usage')

const usage = commandLineUsage([
  {
    header: 'Options',
    optionList: [
      {
        description: 'Display this usage guide.',
        alias: 'h',
        type: Boolean
      },
      {
        description: 'Timeout value in ms.',
        alias: 't',
        type: Number,
        typeLabel: '{underline ms}'
      }
    ]
  }
])

console.log(usage)

Now, it returns the following output.


Options

  -h      Display this usage guide.
  -t ms   Timeout value in ms.

command-line-usage - v6.0.0

Published by 75lb over 5 years ago

Breaking changes since v5.0.5

  • Support for node versions less than v8 removed.

Bug fixes

  • typeLabel now indicates an array for lazyMultiple options. #22
  • typeLabel now defaults to a string. #23

Other improvements

  • Upgraded dependency tree. Bundle size reduced by 33%.
  • Moved all the examples to the wiki
  • Increased test coverage.

Upgrade notes

There have been no changes to the public API of this module. If you are using node v8 or above, you can upgrade safely.

command-line-usage - v5.0.0

Published by 75lb over 6 years ago

Breaking changes since v4.1.0

New features

Upgrading

If your usage guide does not use inline ansi formatting you can upgrade from v4 to v5 without change. If your guide does use ansi formatting you will need to upgrade the syntax, for example [underline](some text) becomes {underline some text}.

command-line-usage - v4.0.0

Published by 75lb almost 8 years ago

Breaking changes since v3.0.8

Removed support for Node less than v4.0.0. Users of old versions of Node can continue to use the previous version of this module.

command-line-usage - v3.0.0

Published by 75lb over 8 years ago

Breaking changes since v2

The commandLineUsage() API changed. Previously, the usage guide template was fixed and you supplied an object containing template data. Now it takes an array of arbitrary section objects. You have full control over the content, you can add a section for anything you like.

Package Rankings
Top 19.24% on Repo1.maven.org
Top 1.53% on Npmjs.org
Badges
Extracted from project README
view on npm npm module downloads Gihub repo dependents Gihub package dependents Node.js CI Coverage Status js-standard-style
Related Projects