# cosmiconfig: 6.5 out of 10

Reasonable, with limits. 7th of 9 in [Config and environment variables](https://elestia.ai/opensource/config/index.md).

cosmiconfig finds and loads a tool's config file from package.json, rc files, JSON, YAML, JS or TypeScript. It is a mature, safe choice for authors of CLIs and dev tools. It does not handle env vars, secrets or validation, so it is not the right pick for loading an app's own settings, and its share is shrinking as c12 and lilconfig gain ground.

**Best for:** Authors of CLIs and dev tools who want users to configure the tool in any of the usual rc and config-file places.

## Scores

- **Overall: 6.5** (likely 5.4 to 7.5)
  - Claude Opus 5.5 (5.5): It is a solid, safe config-file finder for tool authors and still gets updates. For this category's job of loading app settings and secrets and checking them, it covers only file discovery: no env vars, no validation. In its own niche, c12 offers more and grows faster, and lilconfig is lighter. So it is a reasonable but limited choice today.
  - GPT-6.2 Sol (7.5): Cosmiconfig is a strong new-project choice for conventional config discovery in a Node.js CLI, with a small API and evidence from active downstream tools. c12 offers more for apps that need environment-specific layers and live reload, while T3 Env fits teams whose main need is validated environment variables. The newer Node requirement, concentrated release work, and below-median download growth temper the two-year outlook.
- **Needed by many: 4.1** (likely 3.1 to 5.2)
  - Claude Opus 5.5 (4.0): Its job is finding config files for CLIs and dev tools, which is a clear niche within this category. Most app developers here need env vars and validation instead. Many developers run it without knowing it, but few choose it directly.
  - GPT-6.2 Sol (4.2): Config discovery matters across Node.js tooling, especially for CLIs, linters, and generators that let users choose how to configure them. Applications that mainly need deployment settings, validated environment variables, or secrets have less reason to choose it. Adoption by several tools establishes the use case, but the share of developers who need to build that capability is hard to measure.
- **Helps a lot: 7.1** (likely 6.0 to 8.1)
  - Claude Opus 5.5 (6.5): It finds and loads files well. It supports many formats, caching, transforms, $import for config inheritance, and global OS config folders. v10 dropped heavy dependencies and loads TypeScript natively, but it gave up compiled TS syntax and needs a recent Node. It has no watching or env layering like c12, and no validation, so it does only part of the category's job.
  - GPT-6.2 Sol (7.6): The typed search and load API is easy to follow, supports custom loaders, and finds common config formats with little setup. The parsed config is typed as any, and the README still cites Node 14 even though the package requires a newer runtime. A user-reported global search hang remains in v10.0.1. One independent c12 comparison found mixed performance by format, but mostly used Node versions outside cosmiconfig's supported range.
- **Holds up over time: 6.4** (likely 5.3 to 7.4)
  - Claude Opus 5.5 (6.0): It is still maintained: 35 commits and 3 releases in the past year, including a new major version (v10) in August 2026. A small group of maintainers does the work, with no visible funding, and some issues have been open for years. Two breaking majors in a short time and some tools moving to lilconfig or c12 add risk.
  - GPT-6.2 Sol (6.8): The project shipped three GitHub releases and made 35 commits in the past year, including a major update and a dependency security patch. A reported search bug got a merged fix in about three weeks, and that fix is still awaiting a release. One maintainer handled the recent releases, and the higher Node minimum and TypeScript changes create upgrade work. The project lists GitHub Sponsors, but the level of funding and depth of backup maintenance are unclear.
- **Used widely: 6.4** (likely 5.1 to 8.0)
  - Claude Opus 5.5 (6.0): Its raw numbers are huge: 692M downloads in 4 weeks and 3.5M dependent repos. Almost all of that comes from dev tools that install it, not from people choosing it. Its growth ratio is 2.2, well below the 4.1 median, so it is losing ground, while c12 grew 5.7x. About 3,400 packages choose it directly, which is still a lot for a library aimed at tool authors.
  - GPT-6.2 Sol (6.8): About 692 million four-week downloads and 3.5 million reported dependent repositories show a large installed footprint. The 3,392 reported dependent packages and 4,172 stars also point to substantial use, but installs through tools such as Stylelint and commitlint make direct choices hard to estimate. Downloads rose 2.19 times year over year, below both the catalog median of 4.1 and c12's 5.66, so cosmiconfig lost ground on the catalog measure. One Bluesky post and zero matched Hacker News stories provide little evidence about new adoption.
- **Vouched for: 7.1** (likely 5.7 to 8.0)
  - Claude Opus 5.5 (6.0): Widely used tools such as commitlint, stylelint, svgo and ts-jest have used it in production for years, which counts as real validation. It has no recent independent write-ups or survey data, and some well-known tools have moved to lilconfig. The evidence is mostly the list of who depends on it.
  - GPT-6.2 Sol (8.1): Stylelint 18.1 ships with cosmiconfig v10, and commitlint and GraphQL Code Generator document relying on it for configuration discovery. These integrations show that the API works for real tools with different users and config conventions. Version-specific evidence beyond Stylelint is thinner, and the State of JavaScript survey offers no cosmiconfig satisfaction measure.
- **Safe: 7.5** (likely 6.3 to 8.5)
  - Claude Opus 5.5 (7.5): It has no advisories ever, an MIT licence and only 2 runtime dependencies after v10. The OpenSSF Scorecard is 5, with weak code review, unpinned dependencies and no security policy. Its very wide install base makes it a target for supply-chain attacks, but it has had no incident.
  - GPT-6.2 Sol (7.4): The MIT package has two direct dependencies and zero listed OSV advisories of its own. v10.0.1 adopted a js-yaml security fix four days after the upstream patch, and the maintainer enabled private vulnerability reporting on the day it was requested. The OpenSSF Scorecard is 5 out of 10, with weak code review, unpinned workflow dependencies, and no public security policy. Two npm maintainers are listed, recent releases came from one of them, and the signed GitHub tag leaves npm build provenance uncertain.

## Good

- It searches the usual places (a package.json key, .toolrc, the .config/ folder, *.config.js/ts/mjs/cjs) with one call.
- v10 loads TypeScript config through Node's type stripping and has only 2 runtime dependencies.
- It has no known advisories in its 11-year history and uses the MIT licence.
- The API is stable and widely known, and many tools use it, so AI agents write correct code for it easily.

## Bad

- It does not load env vars or secrets and does not validate the config against a schema.
- v10 requires Node ^22.18 or >=24, and its TypeScript loading rejects enums and namespaces.
- v9 stopped searching parent directories by default, which broke setups that relied on the old search.
- Several feature requests from 2018 to 2023 are still open, including slow searches in large repos and TOML support.

## The numbers

- Downloads, 4 weeks: 692M
- In a year: ×2.2
- GitHub stars: 4.2k
- Commits, 12 months: 35
- Last npm release: Aug 2026
- Advisories, 24 months: 0
- Licence: MIT
- GitHub: https://github.com/cosmiconfig/cosmiconfig
- npm: https://www.npmjs.com/package/cosmiconfig

Scores run from 0 to 10 and are the mean of the scores of AI reviewers (Claude Opus 5.5, GPT-6.2 Sol), made on 22 November 2026 from GitHub, npm, OSV, OpenSSF Scorecard, ecosyste.ms, Hacker News and Bluesky data and a web search. The ecosyste.ms count of repositories that use a project is far too low for projects that grew in the last few years, and some reviews quote it. Overall is the reviewers' own judgement for a new project today, not an average of the parts. An AI wrote them and can be wrong.
