c12
A strong pick. 4th of 9 config and environment variables.
c12 is UnJS's loader for config files. It finds, loads and merges files such as `tool.config.ts`, JSON, YAML, TOML, rc files and .env, and it supports layers, `extends` and watching. It is one of the best modern picks for authors of CLIs and frameworks. For an app that mainly needs to validate its env vars and secrets, peers such as T3 Env, envalid or dotenvx fit better. The npm `latest` tag points to 4.0.0-rc.4. v3.3.4 is the last stable line, and v4 has been in beta or release candidate since February 2026.
Best for: Authors of CLIs, build tools and frameworks who want users to write a typed `*.config.ts` with layers, env overrides and watch support.
Scores
Overall7.0
How strongly do we recommend it for a new project today?
Claude Opus 5.5: 6.5, likely 5.5 to 7.5
For tool and framework authors it is a strong, modern replacement for cosmiconfig, with fast growth and Nuxt-scale use. For this category's main job, loading and checking an app's settings and secrets, it is a side choice: dotenv or dotenvx plus T3 Env or envalid fit most apps better. The long v4 RC with breaking changes also keeps the score down.
- npm downloads ratio: Gaining faster than the median
- github.com/unjs/c12/releases: v4 is still an RC, with breaking migration steps
- peers: dotenv, dotenvx, T3 Env and envalid target app env validation more directly
GPT-6.2 Sol: 7.4, likely 6.2 to 8.5
Stable c12 is a strong pick when a Node.js project needs reusable config layers, per-environment settings, and reloads. Cosmiconfig is a better fit for conventional config discovery, and T3 Env better serves teams that mainly need typed environment validation. Active development and proven downstream use support c12, while the v4 transition and uncertain pace of stable fixes keep the recommendation below a category default.
- github.com/unjs/c12/blob/v3.3.4/README.md: Stable docs establish c12’s layered config and reload features.
- github.com/unjs/c12/releases: Stable 3.3.4 remains available while v4 advances through candidates.
- github.com/cosmiconfig/cosmiconfig: Peer offers broader default config discovery.
- env.t3.gg/docs/core: Peer focuses on typed environment checks and client/server boundaries.
Needed by many4.8
How many developers need a tool for this job?
Claude Opus 5.5: 4.0, likely 3.0 to 5.5
c12 serves people who build tools that read user config files. That is a clear niche compared with every app that needs env vars. App developers can use it, but most of them only need dotenv plus validation. It runs on any runtime and is not tied to Nuxt, which keeps it from being narrower.
- github.com/unjs/c12: Smart config loader for config files, rc files, package.json and .env
- dependents: 141 dependent packages, a sign that its users are mainly tool authors
GPT-6.2 Sol: 5.5, likely 4.3 to 6.7
Loading settings and secrets is a common need in JavaScript and TypeScript. c12’s take is most useful for Node.js apps and tools that need layered files, while Node.js itself can load a simple .env file. Developer surveys establish the size of the Node.js audience, but leave demand for layered config uncertain.
- github.com/unjs/c12/blob/v3.3.4/README.md: Stable docs show file layering, overrides, and dotenv support.
- nodejs.org/api/environment_variables.html: Node.js includes built-in .env loading.
- survey.stackoverflow.co/2025/technology: Survey establishes broad Node.js use.
Helps a lot7.2
How well does it do the job for those who need it?
Claude Opus 5.5: 7.0, likely 6.0 to 8.0
For loading tool config it is very capable. It covers many formats, native import with a jiti fallback, defu merging, layers, remote `extends`, env-specific keys, watching with HMR, and now standard-schema validation and `${VAR:-default}` in dotenv. Its limits are thin docs (a README only), types that one user calls heavy once you customise the pipeline, and an open bug where `updateConfig` silently drops changes. For checking app secrets, dedicated env validation peers do the job better.
- github.com/unjs/c12/releases: v4 RCs add schema validation, dotenv fallbacks, multiple envNames, and smaller and faster installs
- github.com/unjs/c12/issues: 17 open issues, mostly feature requests; one updateConfig bug
- bluesky top posts: One user says the pipeline is tightly woven and the types get heavy
GPT-6.2 Sol: 7.4, likely 6.3 to 8.5
Stable 3.3.4 handles typed JavaScript and TypeScript config, nested layers, .env loading, and file watching through a documented API. Teams need a separate runtime check on v3 because the schema option arrives in v4. The independent benchmark found mixed results against cosmiconfig and tested a v4 candidate, so stable-version performance remains uncertain.
- github.com/unjs/c12/blob/v3.3.4/README.md: Stable examples cover file formats, merge order, and watching.
- raw.githubusercontent.com/unjs/c12/v3.3.4/src/types.ts: Stable loader declares typed options and results.
- github.com/unjs/c12/releases: v4 RC2 introduced Standard Schema validation.
- shoppercove.com/blog/c12-vs-cosmiconfig: Independent RC benchmark found faster JavaScript loads and slower cold starts.
Holds up over time7.2
Will it still be a good choice in two years?
Claude Opus 5.5: 7.0, likely 5.5 to 8.0
Work is active: 93 commits and 11 releases in the last year, a push the day before this review, and steady RCs. It sits under UnJS and Nuxt, which are commercially backed. The v4 cycle has run long, though, and it brings breaking changes (peer dependencies, the native watcher replacing chokidar, `expandFileReferences` off by default). Much of the work depends on one lead maintainer.
- github commitsLastYear / releasesLastYear: 93 commits and 11 releases in the last year
- github.com/unjs/c12/releases: v4 beta since February, rc.4 in October; breaking changes listed
- github contributors: 41 contributors, 197 merged PRs
GPT-6.2 Sol: 7.4, likely 6.2 to 8.5
The repository recorded 93 commits and 11 GitHub releases in a year, and release-it resolved a user-reported config discovery bug by updating c12. Most recent tags advance v4, which changes the watcher and makes some previously bundled dependencies optional. The visible releases are concentrated with one publisher, and dedicated funding and future v3 maintenance are unclear.
- github commitsLastYear, releasesLastYear, contributors, pushedAt: 93 commits, 11 releases, 41 total contributors, and a recent push.
- github.com/unjs/c12/releases: Shows release publisher, recent v4 work, and migration changes.
- github.com/release-it/release-it/issues/1254: A c12 upgrade addressed a reported config discovery bug.
Used widely5.2
How many use it, and is that growing?
Claude Opus 5.5: 5.5, likely 4.5 to 6.5
Downloads went from 27.9M to 157.7M per 4 weeks, a ratio of 5.65 against the median of 4.1, so it is gaining ground. Most of those downloads come in through Nuxt, Nitro, unbuild and other tools. Its 7,800 dependent repos and 141 packages are far below cosmiconfig's and dotenv's millions but above T3 Env and envalid. Direct choices are probably in the tens of thousands, and some tools, such as release-it, are switching to it.
- npm downloadsLast4Weeks / downloadsSame4WeeksYearAgo: 157.7M vs 27.9M, ratio 5.65 vs median 4.1
- dependents: 7,800 repos and 141 packages, against cosmiconfig's 3.5M
- bluesky top posts: release-it got a PR to replace cosmiconfig with c12
GPT-6.2 Sol: 4.9, likely 3.6 to 6.3
Four-week downloads rose from 27.9 million to 157.7 million, about 5.65 times the prior year and ahead of the catalog median of 4.1. Nuxt and Prisma install c12 downstream, so the download trend gives only indirect evidence of new projects choosing it. The sampled 7,800 dependent repositories exceed T3 Env and envalid but trail node-config and cosmiconfig by a wide margin.
- npm downloadsLast4Weeks, npm downloadsSame4WeeksYearAgo, medianDownloadsRatio: Downloads grew about 5.65 times against a 4.1-times baseline.
- dependents, peers dependentRepos, github stars, bluesky posts: 7,800 repositories, 141 packages, 907 stars, and six Bluesky posts.
- github.com/nuxt/nuxt/blob/main/docs/4.api/5.kit/2.programmatic.md: Nuxt Kit loads configuration through c12.
- raw.githubusercontent.com/prisma/prisma/7.10.0/packages/config/package.json: Prisma config pins c12 3.3.4.
Vouched for6.9
Who stands behind it being good?
Claude Opus 5.5: 6.0, likely 4.5 to 7.0
Nuxt and Nitro build on it in production, and other tools are moving to it from cosmiconfig: release-it, and a mycoder migration proposal. That is real validation from projects with something to lose. It does not appear in developer surveys, and there are no independent benchmarks or detailed write-ups, so most of the backing comes from the UnJS ecosystem itself.
- bluesky top posts: Nuxt core maintainer says Nuxt layers are built on c12; release-it is adopting it
- github.com/drivecore/mycoder/issues/261: A third-party project proposes moving from cosmiconfig to c12
- unjs.io/packages/c12: Part of the UnJS toolkit that Nuxt uses
GPT-6.2 Sol: 7.8, likely 6.6 to 8.8
Nuxt uses c12 behind its public config API, and Prisma and release-it pin stable 3.3.4. Those integrations show that several projects trust it with a core part of their tooling. The independent benchmark supports the case for layered config, but covers a release candidate on one machine, and direct satisfaction data for c12 is scarce.
- github.com/nuxt/nuxt/blob/main/docs/4.api/5.kit/2.programmatic.md: Documents c12 beneath Nuxt’s public loader.
- raw.githubusercontent.com/prisma/prisma/7.10.0/packages/config/package.json: Prisma ships the stable loader as a direct dependency.
- raw.githubusercontent.com/release-it/release-it/main/package.json: release-it pins c12 3.3.4.
- shoppercove.com/blog/c12-vs-cosmiconfig: Independent tests found useful merging and mixed performance.
Safe7.2
How safe is it to depend on?
Claude Opus 5.5: 7.5, likely 6.0 to 8.5
It has no known advisories, an MIT licence, and v4 pulls in only 6 to 7 dependencies, down from 20. There is no OpenSSF Scorecard to check how releases are published. By design it runs config code and can fetch remote layers through giget, which widens the attack surface when those features are used.
- advisories: 0 advisories ever
- npm dependencies: 6 dependencies in the current version
- scorecard: No Scorecard data
- github.com/unjs/c12/releases: giget is now an optional peer, used only for remote extends
GPT-6.2 Sol: 6.8, likely 5.5 to 8.0
c12 uses the permissive MIT license, and the advisory snapshot lists no reports against the package. Stable 3.3.4 declares 12 direct dependencies and can execute JavaScript or TypeScript config, including config from remote layers when configured. GitHub shows no security policy, and the missing Scorecard and limited visibility into npm publishing controls leave the range wide.
- advisories, scorecard: Zero OSV advisories and no OpenSSF Scorecard result.
- raw.githubusercontent.com/unjs/c12/v3.3.4/package.json: Stable manifest lists MIT, 12 direct dependencies, and a release script.
- github.com/unjs/c12/blob/v3.3.4/README.md: Documents executable config and extending remote sources.
- github.com/unjs/c12/security: GitHub detects no security policy.
Good
- It loads TS, JS, JSON5, YAML, TOML, rc files, package.json and .env through one `loadConfig` call, with a clear merge order.
- Layers and `extends` can pull from local paths, npm or git, and `$production`/`$development` keys give per-environment settings.
- v4 cuts the install from 3.44 MB to 380 kB and from 20 dependencies to 7, and cold TS loads run about 2.5x faster.
- It runs in production at scale as the config loader of Nuxt, Nitro and the wider UnJS toolchain.
Bad
- v4 has sat in beta and release candidate for nine months, and the npm `latest` tag points to an RC with breaking changes (peer dependencies, native watcher).
- It is not built to validate app secrets. Schema support only arrived in v4 RCs, and env validation tools do that job better.
- Most of its downloads come in through Nuxt and other tools, so far fewer projects choose it directly than the totals suggest.
- Its development depends heavily on one lead maintainer within UnJS, and the docs are a README only.
The numbers
- npm downloads, 4 weeks
- 158M ×5.7 in a year
- GitHub stars
- 907
- Commits, 12 months
- 93
- npm version
- 4.0.0-rc.4 Oct 2026
- Versions, 12 months
- 2
- Advisories, 24 months
- 0 of 0 ever
- OpenSSF Scorecard
- None
- Licence
- MIT
Read on 21 November 2026 from GitHub (unjs/c12), npm (c12), OSV and the OpenSSF Scorecard.