The complete solution for node.js command-line interfaces. Commander exports a global object which is convenient for quick programs. For larger programs which may use commander in multiple ways, including unit testing, it is better to create a local Command object to use. Each option can have a short flag (single character) and a long name, separated by a comma or space or vertical bar ('|'). Multiple short flags may optionally be combined in a single argument following the dash: boolean flags, followed by a single option taking a value (possibly followed by the value). You may specify a function to do custom processing of option-arguments. The callback function receives two parameters, the user specified option-argument and the previous value for the option. It returns the new value for the option. This allows you to coerce the option-argument to the desired type, or accumulate values, or do entirely custom processing.

Features

  • Simplifies node.js command-line interfaces
  • Stand-alone executable (sub)commands
  • The help information is auto-generated based on the information commander already knows about your program
  • You can add extra text to be displayed along with the built-in help
  • Make lists of arguments, options, and subcommands visible
  • Legacy options as properties

Project Samples

Project Activity

See All Activity >

License

MIT License

Follow Commander.js

Commander.js Web Site

Other Useful Business Software
8 Monitoring Tools in One APM. Install in 5 Minutes. Icon
8 Monitoring Tools in One APM. Install in 5 Minutes.

Errors, performance, logs, uptime, hosts, anomalies, dashboards, and check-ins. One interface.

AppSignal works out of the box for Ruby, Elixir, Node.js, Python, and more. 30-day free trial, no credit card required.
Start Free
Rate This Project
Login To Rate This Project

User Reviews

Be the first to post a review of Commander.js!

Additional Project Details

Operating Systems

Windows

Programming Language

JavaScript

Related Categories

JavaScript User Interface (UI) Software, JavaScript Source Code Analysis Tool

Registered

2021-02-23