Gathering detailed insights and metrics for argparse
Gathering detailed insights and metrics for argparse
Gathering detailed insights and metrics for argparse
Gathering detailed insights and metrics for argparse
CLI arguments parser for node.js. JS port of python's argparse module.
npm install argparse
Typescript
Module System
Node Version
NPM Version
99.6
Supply Chain
95.3
Quality
75.8
Maintenance
100
Vulnerability
99.6
License
JavaScript (100%)
Total Downloads
15,430,145,153
Last Day
6,696,178
Last Week
110,666,564
Last Month
475,289,514
Last Year
4,781,292,961
NOASSERTION License
500 Stars
267 Commits
74 Forks
20 Watchers
2 Branches
21 Contributors
Updated on Jun 27, 2025
Minified
Minified + Gzipped
Latest Version
2.0.1
Package Id
argparse@2.0.1
Size
38.81 kB
NPM Version
6.14.6
Node Version
12.18.3
Published on
Aug 28, 2020
Cumulative downloads
Total Downloads
Last Day
-5.7%
6,696,178
Compared to previous day
Last Week
-7.5%
110,666,564
Compared to previous week
Last Month
3.2%
475,289,514
Compared to previous month
Last Year
24.4%
4,781,292,961
Compared to previous year
CLI arguments parser for node.js, with sub-commands support. Port of python's argparse (version 3.9.0).
Difference with original.
new ArgumentParser({ description: 'example', add_help: true })
.int
, float
, ...
.add_argument('-b', { type: 'int', help: 'help' })
.%r
format specifier uses require('util').inspect()
.More details in doc.
test.js
file:
1#!/usr/bin/env node 2'use strict'; 3 4const { ArgumentParser } = require('argparse'); 5const { version } = require('./package.json'); 6 7const parser = new ArgumentParser({ 8 description: 'Argparse example' 9}); 10 11parser.add_argument('-v', '--version', { action: 'version', version }); 12parser.add_argument('-f', '--foo', { help: 'foo bar' }); 13parser.add_argument('-b', '--bar', { help: 'bar foo' }); 14parser.add_argument('--baz', { help: 'baz bar' }); 15 16console.dir(parser.parse_args());
Display help:
$ ./test.js -h
usage: test.js [-h] [-v] [-f FOO] [-b BAR] [--baz BAZ]
Argparse example
optional arguments:
-h, --help show this help message and exit
-v, --version show program's version number and exit
-f FOO, --foo FOO foo bar
-b BAR, --bar BAR bar foo
--baz BAZ baz bar
Parse arguments:
$ ./test.js -f=3 --bar=4 --baz 5
{ foo: '3', bar: '4', baz: '5' }
Since this is a port with minimal divergence, there's no separate documentation. Use original one instead, with notes about difference.
Available as part of the Tidelift Subscription
The maintainers of argparse and thousands of other packages are working with Tidelift to deliver commercial support and maintenance for the open source dependencies you use to build your applications. Save time, reduce risk, and improve code health, while paying the maintainers of the exact dependencies you use. Learn more.
No vulnerabilities found.
Reason
no dangerous workflow patterns detected
Reason
no binaries found in the repo
Reason
0 existing vulnerabilities detected
Reason
security policy file detected
Details
Reason
license file detected
Details
Reason
Found 6/24 approved changesets -- score normalized to 2
Reason
detected GitHub workflow tokens with excessive permissions
Details
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
dependency not pinned by hash detected -- score normalized to 0
Details
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
project is not fuzzed
Details
Reason
branch protection not enabled on development/release branches
Details
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
Score
Last Scanned on 2025-06-23
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More