minimist

A lightweight, dependency-free argument parser that turns process.argv into a clean options object.

Library
npm
v1.2.8
661 stars
MIT License

Repository Health

Pre-computed score based on development activity, maintenance, community, maturity, and trend momentum. How we score it →
38 /100 Needs Attention
Development Activity 0
Maintenance 0
Community 56
Maturity 56
Momentum 40

Technical Analysis

AI-assessed by reading the actual repository — architecture, code quality, innovation, and documentation. How we score it →
61 /100 Good
Architecture 58
Code Quality 80
Innovation 60
Learning Curve 45

Minimist is the argument-parsing engine originally extracted from optimist, stripped down to just the core logic for converting an array of command-line arguments into a structured object. It handles the full range of common argv patterns — long flags (--foo=bar), short flags bundled together (-abc), negation (--no-foo), boolean and string coercion, aliases, and defaults — with zero runtime dependencies.

Because it does one job well, minimist has become a foundational parsing layer underneath a large share of the Node.js CLI ecosystem, used directly or wrapped by higher-level libraries. Its small, synchronous API makes it easy to drop into any script that needs to read process.argv without pulling in a full CLI framework.

What You Get

  • A single exported function that takes (args, opts) and returns a populated argv object
  • Support for long (--foo=bar), short (-f bar), and bundled short flags (-abc)
  • Boolean negation via --no-foo and explicit opts.boolean coercion
  • Alias resolution so multiple flag names resolve to the same value
  • Dotted-key expansion (--foo.bar=x) into nested objects
  • Defaults, stopEarly, and -- passthrough handling for everything after a literal --

Common Use Cases

  • Parsing options in a small standalone Node.js CLI script
  • Acting as the low-level argv tokenizer underneath a higher-level CLI framework
  • Accepting flags like --watch or --env=production in internal build/test tooling
  • Quick prototyping of one-off Node.js scripts that need argument parsing without ceremony

Under The Hood

Architecture Minimist is a single-file, monolithic module (index.js, ~270 lines) with no internal layering — one exported function closes over local state (flags, aliases, defaults) and mutates a local argv object while iterating the input array once. There’s no plugin system or injectable strategy; every behavior is configured through the single opts object passed at the one call site, and the dense character-by-character short-flag parsing loop is the single path all bundled -abc-style input flows through, meaning any change to it ripples across every consumer.

Tech Stack The package has zero runtime dependencies and targets Node >= 0.4, using only plain ES5-style JavaScript ('use strict', var, function declarations) for maximum compatibility. Development tooling includes tape for tests, nyc for coverage, eslint with the @ljharb/eslint-config preset, auto-changelog for release notes, and safe-publish-latest/in-publish guards around the publish lifecycle — all as devDependencies only.

Code Quality Tests are extensive relative to the module’s size: sixteen dedicated test files under test/ cover short flags, long flags, arrays, booleans, dotted keys, whitespace, unknown-argument callbacks, and prototype-pollution safety (proto.js), all run through tape. Coverage is measured via nyc with configured thresholds (86% lines, 76% branches) though hard enforcement is disabled. Linting runs as a pretest step and CI (GitHub Actions) exercises multiple Node version ranges plus a posttest npm audit. Error handling is implicit rather than explicit — malformed input is coerced rather than throwing — which fits a permissive CLI-parsing utility, and there are no TypeScript types in the repository itself.

API Design The public surface is a single default export, parseArgs(args, opts), returning a plain object — about as low-boilerplate as argument parsing gets: require('minimist')(process.argv.slice(2)) is a complete integration. Configuration is one flat opts object (string, boolean, alias, default, stopEarly, '--'), which keeps the common path simple, though discovering less obvious behaviors like dotted-key nesting or the unknown callback requires reading the README closely, since it’s the only documentation source — there are no in-repo JSDoc or .d.ts annotations.

Used by 20 apps in this directory

TypeScript
53%
Other

Chaskiq

CRM · Customer Support

3,574

Self-hosted live chat, video calls, help center, and marketing automation — a full-stack Intercom alternative you run on your own infrastructure.

View details
57
Repo Health
66
Technical
66
Dependency
Built with
TypeScript 53%
Ruby 36%
Updated 3 months ago
TypeScript
98%
Apache 2.0

Cline

AI Code Assistants

69,455

An open-source AI coding agent that lives in your editor and terminal — reads and edits your codebase, runs commands, browses the web, and requires human approval for every action by default.

View details
90
Repo Health
74
Technical
65
Dependency
Built with
TypeScript 98%
Updated 4 days ago
TypeScript
92%
MIT

Dittofeed

Automation · Marketing

2,968

Open-source omni-channel customer engagement platform for automating transactional and marketing messages via email, SMS, WhatsApp, Slack, and mobile push.

View details
54
Repo Health
75
Technical
62
Dependency
Built with
TypeScript 92%
Updated 6 months ago
TypeScript
94%
AGPL 3.0

Element Web

Collaboration · Team Chat

13,518

A polished, self-hostable Matrix client for secure, decentralized messaging and collaboration that puts your organization in full control of its data.

View details
96
Repo Health
83
Technical
65
Dependency
Built with
TypeScript 94%
Updated 5 days ago
Python
63%
BSD 3

Flagsmith

Ab Testing Experimentation · Developer Tools · Devops

6,577

Open-source feature flagging, remote config, and A/B/multivariate testing platform for web, mobile, and server-side apps — self-host or use the hosted SaaS.

View details
90
Repo Health
82
Technical
63
Dependency
Built with
Python 63%
TypeScript 31%
Updated 6 days ago
TypeScript
54%
Other

Focalboard

Collaboration · Productivity · Project Management

26,491

Self-hosted, open source project management with Kanban, table, gallery, and calendar views — a privacy-first alternative to Trello, Notion, and Asana.

View details
56
Repo Health
82
Technical
64
Dependency
Built with
TypeScript 54%
Go 40%
Updated 4 months ago
JavaScript
65%
Other

GDevelop

Design Tools · Developer Tools · Game Development

26,937

No-code, open-source game engine for building 2D, 3D and multiplayer games — publish to iOS, Android, Steam and the web.

View details
93
Repo Health
82
Technical
61
Dependency
Built with
JavaScript 65%
C++ 23%
TypeScript 11%
Updated 4 days ago
TypeScript
97%
Other

GrowthBook

Ab Testing Experimentation · Analytics · Developer Tools

8,446

Open source feature flags, A/B testing, and warehouse-native experimentation that queries your existing data infrastructure—no data movement required.

View details
92
Repo Health
85
Technical
63
Dependency
Built with
TypeScript 97%
Updated 4 days ago
TypeScript
96%
MIT

HyperDX

Analytics · Developer Tools · Monitoring

9,916

Open source observability platform that unifies logs, traces, metrics, and session replays on ClickHouse — now the core of ClickStack.

View details
87
Repo Health
83
Technical
65
Dependency
Built with
TypeScript 96%
Updated 1 weeks ago

Join founders buildingwith open source

Opinionated takes, migration guides, cost-saving tips, and insights from the open source ecosystem.

Subscribe on Substack
Join 750+ subscribers