commander
npmv15.0.0TypeScriptthe complete solution for node.js command-line programs
Safe to adopt
Yes — commander scores well across adoption, maintenance, weight, supply chain, and licensing. 492.8M downloads per week and 11 known dependents. Last published 103 days ago. 9 releases in the last 2 years.
- AAdoption: grade A, Excellent.
492.8M downloads per week and 11 known dependents.
- BMaintenance: grade B, Good.
Last published 103 days ago. 9 releases in the last 2 years.
- AWeight: grade A, Excellent.
Zero runtime dependencies, about 203 KB installed.
- ASupply chain: grade A, Excellent.
No install scripts, 2 maintainers, and a contained dependency surface.
- ALicense: grade A, Excellent.
MIT — permissive, with no copyleft found in the dependency tree.
Grades are computed deterministically from registry metadata collected by PackageGraph — downloads, dependents, publish dates, the resolved dependency tree, maintainer count, and declared licenses. No third-party scores are used.
Install cost
What you actually take on by adding commander to a project.
Runtime packages this one declares itself.
Distinct packages in the full runtime tree, deduplicated the way a package manager would.
Unpacked size of this package plus its entire runtime tree.
Longest resolved dependency chain below this package.
Compatibility
- Node.js
- node >=22.12.0
- Module format
- ESM only
- TypeScript
- Types included
- Install scripts
- None
Quick start
A usage example from the commander README.
import { program } from 'commander';
program
.option('--first')
.option('-s, --separator <char>')
.argument('<string>');
program.parse();
const options = program.opts();
const limit = options.first ? 1 : undefined;
console.log(program.args[0].split(options.separator, limit));commander vs the alternatives
Packages solving a similar problem in the npm ecosystem, compared on the signals that drive an adoption decision.
| Package | Weekly downloads | Dependents | License | Last release |
|---|---|---|---|---|
| commanderthis page | 492.8M | 11 | MIT | 3 months ago |
| yargs-parser | 248M | 2 | ISC | 16 days ago |
| yargs | 0 | 12 | MIT | 16 days ago |
| meow | 41.2M | 1 | MIT | 16 days ago |
| dashdash | 20.1M | 1 | MIT | 16 days ago |
| has-flag | 315.4M | 1 | MIT | 16 days ago |
Dependencies
Declared by commander v15.0.0. Runtime dependencies are installed with the package; dev dependencies are not.
Dev (9)
Used by
Popular packages that depend on commander.
RFC9562 UUIDs
A framework for building native apps using React
A batteries-included SQL query & schema builder for PostgresSQL, MySQL, CockroachDB, MSSQL and SQLite3
A CSS selector engine.
Utility to wait for a TCP port to open.
Native Abstractions for Node.js: C++ header for Node 0.8 -> 26 compatibility
Scripts that autolink Expo modules.
JavaScript implementations of network transports, cryptography, ciphers, PKI, message digests, and various utilities.
Types for the Expo config object app.config.ts
React Native CLI
Programmatic access to the ARIA specification
Relationship graph
Dependencies (left) and dependents (right) of commander.
Frequently installed together
An AST-based pattern checker for JavaScript.
Prettier is an opinionated code formatter
BDD/TDD assertion library for node.js and the browser. Test framework agnostic.
TypeScript definitions for node
A JavaScript implementation of the Unicode Bidirectional Algorithm
A JavaScript implementation of many web standards
Check whether a given string matches the `PotentialCustomElementName` production as defined in the HTML Standard.
A tool set for CSS: fast detailed parser (CSS → AST), walker (AST traversal), generator (AST → CSS) and lexer (validation and matching) based on specs and browser implementations
🔎 A simple, tiny and lightweight benchmarking library!
The semantic version parser used by npm.
Reusable require and Node resolution utilities library for Expo
A Promise-based interface into processes created by child_process.spawn
Release history
9 releases in the last two years, typically about 77 days apart.
| Version | Published | Size | License |
|---|---|---|---|
| 15.0.0latest | 3 months ago | 203 KB | MIT |
| 15.0.0-0 | 6 months ago | 203 KB | MIT |
| 14.0.3 | 7 months ago | 204 KB | MIT |
| 14.0.2 | 10 months ago | 203 KB | MIT |
| 14.0.1 | 1 year ago | 203 KB | MIT |
| 14.0.0 | 1 year ago | 203 KB | MIT |
| 13.1.0 | 1 year ago | 196 KB | MIT |
| 13.0.0 | 1 year ago | 195 KB | MIT |
| 13.0.0-0 | 1 year ago | 191 KB | MIT |
| 12.1.0 | 2 years ago | 182 KB | MIT |
| 12.0.0 | 2 years ago | 177 KB | MIT |
| 12.0.0-1 | 2 years ago | 177 KB | MIT |
| 12.0.0-0 | 2 years ago | 174 KB | MIT |
| 11.1.0 | 2 years ago | 173 KB | MIT |
| 11.0.0 | 3 years ago | 171 KB | MIT |
Overview
commander is an npm package that the complete solution for node.js command-line programs. It is extremely widely used, with about 492.8M downloads per week and 11 known dependents in the graph. The latest version is 15.0.0, released under the MIT license.
Who should use it
Teams working in the npm ecosystem who need the complete solution for node.js command-line programs and value a battle-tested, widely-adopted solution.
When not to use it
Consider an alternative if you need to or if a more actively-maintained option better fits your npm stack.
Pros
- Large, well-established user base (492.8M weekly downloads).
- Ships TypeScript type definitions.
- Clear open-source license (MIT).
Cons
- No significant drawbacks detected from available metadata.
Auto-generated from collected registry metadata. No external claims are inferred.
Maintainers
Frequently asked questions
Should I use commander?
Yes — commander scores well across adoption, maintenance, weight, supply chain, and licensing. 492.8M downloads per week and 11 known dependents. Last published 103 days ago. 9 releases in the last 2 years.
How do I install commander?
Run `npm install commander` to add commander to your npm project.
What license is commander released under?
commander is distributed under the MIT license.
How popular is commander?
commander has approximately 492,785,411 downloads per week and 11 known dependent packages.
Is commander still maintained?
The most recent release of commander (v15.0.0) was published 3 months ago.
Does commander run install scripts?
No. commander does not define preinstall, install, or postinstall scripts, so installing it does not execute publisher-supplied code.