1. License
“to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software”
MIT allows use in paid and closed products.
github.com/minimistjs/minimist/blob/main/LICENSE2. Maintained
github.com/minimistjs/minimist3. Used by agents' projects
Dependency in 13 public GitHub projects set up for AI coding agents that we scanned (0.2%).
4. Agent access
Agent skills for this library in the skills catalog; community skills are written by others, read them before you install.
From the package registry and GitHub, checked daily; card checked Nov 11, 2026. Tap a verdict to see its source.How we checkedReport an error
What minimist does
minimist is a tiny free JavaScript library for Node.js scripts. It takes the words a person types after a command, like "--width 800 -v photos/", and turns them into named values your script can use. It does not print help pages, does not check for typos and does not ask questions; bigger tools do that.
What people build with it
Options for a small project script
A build, backup or import script in your project reads a few switches, such as an output folder or a dry-run flag, with one line of code.
Keep codes as text, flags as yes or no
Your export script takes a zip code like 007 and a --dry-run switch. You say which options are text and which are on-off, so no value changes kind.
Short names, defaults and pass-through
A deploy script accepts -e as a short form of --env, fills in a default region, and hands everything after -- to the next program untouched.
Catch mistyped options
When someone types --widht instead of --width, your script says so instead of quietly ignoring it.
Read options inside an AI agent's tools Idea
A small helper script that your coding assistant runs, like "fetch-docs --limit 5 topic", reads its options without adding a large package to the project.
minimist popularity
Gid Score measures public popularity and activity, not quality. How the Gid Score is calculated
How minimist is used
- minimist is a dependency in 13 of the 6,258 public GitHub projects set up for AI coding agents that we scanned, too few to describe it from them alone. Our scan also samples projects by dependency (Solana 3,067, Ethereum and EVM 1,774, 3D and games 3,130, agent frameworks and SDKs 13,750); counting those, it appears in 53 projects, and what it is used with below comes from all of them.
- The most used alternative in our scan is Commander (174 projects).
- Projects that use it most often also use rimraf (43.4%), Husky (41.5%), ESLint (71.7%).
By coding agent
Often used with
More about minimist
Funding
- GitHub Sponsors: https://github.com/ljharb
- GitHub Sponsors: https://github.com/shadowspawn
- Tidelift: https://tidelift.com/funding/github/npm/minimist
- 55 GitHub sponsors
More in Dev workflow and config
Alternatives
minimist This page
Pick Commander when your tool has several commands and needs a help page and errors for wrong options made for you.
Pick yargs when you want automatic help and usage text, required options and checks on top of the parsing.
Pick yargs-parser for the same small job as minimist with more settings, such as number and array options.
Get started
Tell your AI assistant
“In this Node.js script use minimist 1.2.8 to read --out (alias -o, string), --dry-run (boolean) and the input files from argv._, list every text option in opts.string so values like 007 stay text, and reject unknown options with opts.unknown.”
Add the package to your Node.js project.
npm install minimistPass it the typed words (without the first two, which are Node and the script path) and read the result.
const parseArgs = require('minimist'); const argv = parseArgs(process.argv.slice(2), { string: ['out'], boolean: ['dry-run'], alias: { o: 'out' } });
Mistakes to avoid
Numbers are converted by default; our run turned 007 into 7 and 0042 into 42.
Without it our run returned the text "false", which counts as true in an if.
The first two entries are the Node program and the script path, which then land in argv._.
Older versions let crafted options such as --__proto__.x change shared objects.
Unknown options are simply added to the result unless your unknown function returns false.
Questions
Why did --zip 007 come back as 7?
Anything that looks like a number is turned into a number unless you list that option in opts.string.
How do I turn a switch off?
Type --no-name; minimist gives false for name.
Can I use it with import instead of require?
Yes, the README shows both ways.
Can I use it in a paid product?
Yes, it is under the MIT license; keep its notice with copies of the code.