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

You Might Also Like
Gen AI apps are built with MongoDB Atlas Icon
Gen AI apps are built with MongoDB Atlas

Build gen AI apps with an all-in-one modern database: MongoDB Atlas

MongoDB Atlas provides built-in vector search and a flexible document model so developers can build, scale, and run gen AI apps without stitching together multiple databases. From LLM integration to semantic search, Atlas simplifies your AI architecture—and it’s free to get started.
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