</>PackageGraphPackageGraph

commander

npmv15.0.0TypeScript

the 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.

0
Direct dependencies

Runtime packages this one declares itself.

0
Total installed

Distinct packages in the full runtime tree, deduplicated the way a package manager would.

203 KB
Install size

Unpacked size of this package plus its entire runtime tree.

Tree depth

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.

PackageWeekly downloadsDependentsLicenseLast release
commanderthis page492.8M11MIT3 months ago
yargs-parser248M2ISC16 days ago
yargs012MIT16 days ago
meow41.2M1MIT16 days ago
dashdash20.1M1MIT16 days ago
has-flag315.4M1MIT16 days ago

Dependencies

Declared by commander v15.0.0. Runtime dependencies are installed with the package; dev dependencies are not.

Dev (9)

@eslint/js ^10.0.1@types/node ^22.7.4eslint ^10.0.2eslint-config-prettier ^10.0.1globals ^17.3.0prettier ^3.2.5tsd ^0.33.0typescript ^6.0.2typescript-eslint ^8.12.2

Used by

Popular packages that depend on commander.

Relationship graph

Dependencies (left) and dependents (right) of commander.

Frequently installed together

Release history

9 releases in the last two years, typically about 77 days apart.

Recent versions of commander
VersionPublishedSizeLicense
15.0.0latest3 months ago203 KBMIT
15.0.0-06 months ago203 KBMIT
14.0.37 months ago204 KBMIT
14.0.210 months ago203 KBMIT
14.0.11 year ago203 KBMIT
14.0.01 year ago203 KBMIT
13.1.01 year ago196 KBMIT
13.0.01 year ago195 KBMIT
13.0.0-01 year ago191 KBMIT
12.1.02 years ago182 KBMIT
12.0.02 years ago177 KBMIT
12.0.0-12 years ago177 KBMIT
12.0.0-02 years ago174 KBMIT
11.1.02 years ago173 KBMIT
11.0.03 years ago171 KBMIT

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

Keywords

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.