yargs
npmv18.1.0yargs 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.
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.
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
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.
| Package | Weekly downloads | Dependents | License | Last release |
|---|---|---|---|---|
| yargsthis page | 0 | 12 | MIT | 1 month ago |
| yargs-parser | 178.8M | 2 | ISC | 1 day ago |
| commander | 451.1M | 11 | MIT | 1 day ago |
| dashdash | 0 | 1 | MIT | 1 day ago |
| meow | 36.7M | 1 | MIT | 1 day ago |
| has-flag | 166.9M | 1 | MIT | 1 day ago |
Dependencies
Declared by yargs v18.1.0. Runtime dependencies are installed with the package; dev dependencies are not.
Runtime (6)
Dev (22)
Used by
Popular packages that depend on yargs.
Universal WHATWG Fetch API for Node, Browsers and React Native
Node.js library that communicates with Embedded Dart Sass using the Embedded Sass protocol
The official MongoDB driver for Node.js
Seamless REST/GraphQL API mocking library for browser and Node.js.
A framework for building native apps using React
Download and launch browsers
Code generation tools for React Native
🚇 The JavaScript bundler for React Native.
A quick JavaScript runtime for Atomic CSS compilers.
Display pretty Android and iOS logs without Android Studio or Console.app, with intuitive Command Line Interface.
Delightful JavaScript Testing.
Parse sass files and extract a graph of imports
Relationship graph
Dependencies (left) and dependents (right) of yargs.
Frequently installed together
TypeScript definitions for yargs
Babel plugin which switches Babel to use the Hermes parser.
invariant
flow typed nullthrows
Maps proxy protocols to `http.Agent` implementations
Prettier is an opinionated code formatter
A fast and minimal alternative to globby and fast-glob
TypeScript definitions for node
The semantic version parser used by npm.
A JavaScript parser built from the Hermes engine
TypeScript execution environment and REPL for node.js, with source map support
Delightful JavaScript Testing.
Release history
16 releases in the last two years, typically about 4 days apart.
| Version | Published | Size | License |
|---|---|---|---|
| 18.1.0latest | 1 month ago | 230 KB | MIT |
| 17.7.3 | 2 months ago | 310 KB | MIT |
| 16.2.2 | 2 months ago | 280 KB | MIT |
| 16.2.2-candidate.0 | 2 months ago | 280 KB | MIT |
| 17.7.3-candidate.0 | 3 months ago | 286 KB | MIT |
| 18.0.0 | 1 year ago | 226 KB | MIT |
| 18.0.0-candidate.7 | 1 year ago | 226 KB | MIT |
| 18.0.0-candidate.6 | 1 year ago | 225 KB | MIT |
| 18.0.0-candidate.5 | 1 year ago | 226 KB | MIT |
| 18.0.0-candidate.4 | 1 year ago | 225 KB | MIT |
| 18.0.0-candidate.3 | 1 year ago | 226 KB | MIT |
| 18.0.0-browser.2 | 1 year ago | 226 KB | MIT |
| 18.0.0-browser.1 | 1 year ago | 226 KB | MIT |
| 18.0.0-browser.0 | 1 year ago | 226 KB | MIT |
| 18.0.0-candidate.2 | 1 year ago | 226 KB | MIT |
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
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.