Gathering detailed insights and metrics for minimist
Gathering detailed insights and metrics for minimist
Gathering detailed insights and metrics for minimist
Gathering detailed insights and metrics for minimist
npm install minimist
Typescript
Module System
Node Version
NPM Version
JavaScript (100%)
Total Downloads
0
Last Day
0
Last Week
0
Last Month
0
Last Year
0
MIT License
619 Stars
168 Commits
38 Forks
6 Watchers
2 Branches
18 Contributors
Updated on Jul 11, 2025
Latest Version
1.2.8
Package Id
minimist@1.2.8
Unpacked Size
53.20 kB
Size
15.16 kB
File Count
24
NPM Version
9.4.0
Node Version
19.6.0
Published on
Feb 09, 2023
Cumulative downloads
Total Downloads
Last Day
0%
NaN
Compared to previous day
Last Week
0%
NaN
Compared to previous week
Last Month
0%
NaN
Compared to previous month
Last Year
0%
NaN
Compared to previous year
parse argument options
This module is the guts of optimist's argument parser without all the fanciful decoration.
1var argv = require('minimist')(process.argv.slice(2)); 2console.log(argv);
$ node example/parse.js -a beep -b boop
{ _: [], a: 'beep', b: 'boop' }
$ node example/parse.js -x 3 -y 4 -n5 -abc --beep=boop foo bar baz
{
_: ['foo', 'bar', 'baz'],
x: 3,
y: 4,
n: 5,
a: true,
b: true,
c: true,
beep: 'boop'
}
Previous versions had a prototype pollution bug that could cause privilege escalation in some circumstances when handling untrusted user input.
Please use version 1.2.6 or later:
1var parseArgs = require('minimist')
Return an argument object argv
populated with the array arguments from args
.
argv._
contains all the arguments that didn't have an option associated with
them.
Numeric-looking arguments will be returned as numbers unless opts.string
or
opts.boolean
is set for that argument name.
Any arguments after '--'
will not be parsed and will end up in argv._
.
options can be:
opts.string
- a string or array of strings argument names to always treat as
strings
opts.boolean
- a boolean, string or array of strings to always treat as
booleans. if true
will treat all double hyphenated arguments without equal signs
as boolean (e.g. affects --foo
, not -f
or --foo=bar
)
opts.alias
- an object mapping string names to strings or arrays of string
argument names to use as aliases
opts.default
- an object mapping string argument names to default values
opts.stopEarly
- when true, populate argv._
with everything after the
first non-option
opts['--']
- when true, populate argv._
with everything before the --
and argv['--']
with everything after the --
. Here's an example:
> require('./')('one two three -- four five --six'.split(' '), { '--': true })
{
_: ['one', 'two', 'three'],
'--': ['four', 'five', '--six']
}
Note that with opts['--']
set, parsing for arguments still stops after the
--
.
opts.unknown
- a function which is invoked with a command line parameter not
defined in the opts
configuration object. If the function returns false
, the
unknown option is not added to argv
.
With npm do:
npm install minimist
MIT
9.8/10
Summary
Prototype Pollution in minimist
Affected Versions
< 0.2.4
Patched Versions
0.2.4
9.8/10
Summary
Prototype Pollution in minimist
Affected Versions
>= 1.0.0, < 1.2.6
Patched Versions
1.2.6
5.6/10
Summary
Prototype Pollution in minimist
Affected Versions
>= 1.0.0, < 1.2.3
Patched Versions
1.2.3
5.6/10
Summary
Prototype Pollution in minimist
Affected Versions
< 0.2.1
Patched Versions
0.2.1
0/10
Summary
Withdrawn: ESLint dependencies are vulnerable (ReDoS and Prototype Pollution)
Affected Versions
< 1.2.2
Patched Versions
1.2.2
Reason
no dangerous workflow patterns detected
Reason
no binaries found in the repo
Reason
GitHub workflow tokens follow principle of least privilege
Details
Reason
license file detected
Details
Reason
0 existing vulnerabilities detected
Reason
security policy file detected
Details
Reason
Found 10/25 approved changesets -- score normalized to 4
Reason
0 commit(s) and 2 issue activity found in the last 90 days -- score normalized to 1
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
SAST tool is not run on all commits -- score normalized to 0
Details
Score
Last Scanned on 2025-07-07
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