</>PackageGraphPackageGraph

yargs

npmv18.1.0

yargs the modern, pirate-themed, successor to optimist.

Safe to adopt

Yes — yargs scores well across adoption, maintenance, weight, supply chain, and licensing. No download data reported for this package yet. Last published 46 days ago. 16 releases in the last 2 years.

  • ?Adoption: grade ?, Not reported by this registry.

    No download data reported for this package yet.

  • AMaintenance: grade A, Excellent.

    Last published 46 days ago. 16 releases in the last 2 years.

  • BWeight: grade B, Good.

    Pulls in 9 transitive packages, about 435 KB installed (at least — some of the tree is still being crawled).

  • ASupply chain: grade A, Excellent.

    No install scripts, 3 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 yargs to a project.

6
Direct dependencies

Runtime packages this one declares itself.

9
Total installed

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

435 KB
Install size

Unpacked size of this package plus its entire runtime tree.

2
Tree depth

Longest resolved dependency chain below this package.

Part of this dependency tree has not been crawled yet, so these figures are a lower bound rather than a final total.

Licenses in the dependency tree

ISCMIT

Every license you inherit by installing yargs, not just its own. Check this before a legal review, not after.

Compatibility

Node.js
node ^20.19.0 || ^22.12.0 || >=23
Module format
ESM + CommonJS
TypeScript
No bundled types
Install scripts
None

Quick start

A usage example from the yargs README.

mocha [spec..]

Run tests with Mocha

Commands
  mocha inspect [spec..]  Run tests with Mocha                         [default]
  mocha init <path>       create a client-side Mocha setup at <path>

Rules & Behavior
  --allow-uncaught           Allow uncaught errors to propagate        [boolean]
  --async-only, -A           Require all tests to use a callback (async) or
                             return a Promise                          [boolean]

yargs vs the alternatives

Packages solving a similar problem in the npm ecosystem, compared on the signals that drive an adoption decision.

PackageWeekly downloadsDependentsLicenseLast release
yargsthis page012MIT1 month ago
yargs-parser178.8M2ISC1 day ago
commander451.1M11MIT1 day ago
dashdash01MIT1 day ago
meow36.7M1MIT1 day ago
has-flag166.9M1MIT1 day ago

Dependencies

Declared by yargs v18.1.0. Runtime dependencies are installed with the package; dev dependencies are not.

Dev (22)

@babel/eslint-parser ^7.26.10@babel/preset-typescript ^7.26.0@types/chai ^5.2.3@types/mocha ^9.0.0@types/node ^20.0.0@typescript-eslint/eslint-plugin ^8.26.1browserslist-generator ^3.0.0c8 ^11.0.0chai ^6.2.2chalk ^5.6.2cpr ^3.0.1cross-env ^10.0.0cross-spawn ^7.0.6eslint ^8.57.1eslint-plugin-prettier ^5.1.2gts ^5.3.1hashish 0.0.4mocha ^11.7.6rimraf ^3.0.2typescript ^5.9.3which ^2.0.2yargs-test-extends ^1.0.1

Used by

Popular packages that depend on yargs.

Relationship graph

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

Frequently installed together

Release history

16 releases in the last two years, typically about 4 days apart.

Recent versions of yargs
VersionPublishedSizeLicense
18.1.0latest1 month ago230 KBMIT
17.7.32 months ago310 KBMIT
16.2.22 months ago280 KBMIT
16.2.2-candidate.02 months ago280 KBMIT
17.7.3-candidate.03 months ago286 KBMIT
18.0.01 year ago226 KBMIT
18.0.0-candidate.71 year ago226 KBMIT
18.0.0-candidate.61 year ago225 KBMIT
18.0.0-candidate.51 year ago226 KBMIT
18.0.0-candidate.41 year ago225 KBMIT
18.0.0-candidate.31 year ago226 KBMIT
18.0.0-browser.21 year ago226 KBMIT
18.0.0-browser.11 year ago226 KBMIT
18.0.0-browser.01 year ago226 KBMIT
18.0.0-candidate.21 year ago226 KBMIT

Overview

yargs is an npm package that yargs the modern, pirate-themed, successor to optimist. It has 12 known dependents in the graph. The latest version is 18.1.0, released under the MIT license.

Who should use it

Teams working in the npm ecosystem who need yargs the modern, pirate-themed, successor to optimist and value a focused solution.

When not to use it

Consider an alternative if you need to minimize your dependency tree, have first-class TypeScript types out of the box, or if a more actively-maintained option better fits your npm stack.

Pros

  • Clear open-source license (MIT).

Cons

  • Large dependency tree (28 direct dependencies) increases install size and audit surface.
  • No bundled TypeScript types (may require a separate @types package).

Auto-generated from collected registry metadata. No external claims are inferred.

Maintainers

Keywords

Frequently asked questions

Should I use yargs?

Yes — yargs scores well across adoption, maintenance, weight, supply chain, and licensing. No download data reported for this package yet. Last published 46 days ago. 16 releases in the last 2 years.

How do I install yargs?

Run `npm install yargs` to add yargs to your npm project.

How many dependencies does yargs have?

yargs declares 28 direct dependencies and pulls in 9 packages in total once its runtime tree is resolved totalling about 435 KB on disk.

What license is yargs released under?

yargs is distributed under the MIT license. Its dependency tree also includes: ISC, MIT.

How popular is yargs?

npm does not publish download counts. Within PackageGraph's crawl, 12 known packages depend on yargs.

Is yargs still maintained?

The most recent release of yargs (v18.1.0) was published 1 month ago.

Does yargs run install scripts?

No. yargs does not define preinstall, install, or postinstall scripts, so installing it does not execute publisher-supplied code.