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
Our Free Plans just got better! | Auth0 Icon
Our Free Plans just got better! | Auth0

With up to 25k MAUs and unlimited Okta connections, our Free Plan lets you focus on what you do best—building great apps.

You asked, we delivered! Auth0 is excited to expand our Free and Paid plans to include more options so you can focus on building, deploying, and scaling applications without having to worry about your security. Auth0 now, thank yourself later.
Try free now
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