envalid
Reasonable, with limits. 6th of 9 config and environment variables.
envalid is a small, mature, zero-dependency library that checks environment variables against built-in validators and exits with clear errors. It is still a sound choice for plain Node or Bun servers. T3 Env and Standard Schema-based tools now win most new TypeScript projects, and envalid's usage is growing more slowly than the category.
Best for: Backend Node or Bun services that want simple, typed env checks without adding Zod or another schema library.
Scores
Overall6.6
How strongly do we recommend it for a new project today?
Claude Opus 5.5: 6.0, likely 5.0 to 7.0
envalid is a well-kept, safe, focused validator that suits server apps where adding Zod is not wanted. For most new TypeScript projects, T3 Env or another Standard Schema-based tool gives the same checks plus framework support and reuse of existing schemas. Its growth below the median and its reliance on one maintainer keep it in the reasonable-but-not-default band.
- peers T3 Env downloads: 23M, up 7x, vs envalid's 4.5M, up 2.7x
- pkgpulse.com/guides/best-env-variable-management-nodejs-2026: t3-env is the default; envalid for non-Next servers
- github.com/af/envalid/releases: Active releases through v9.0.0 in October 2026
GPT-6.2 Sol: 7.2, likely 6.1 to 8.2
Envalid is a strong pick for new Node.js and Bun services that need a small, typed startup check. T3 Env is a better fit for shared client and server schemas, and Varlock covers projects that need to load and validate secrets in one workflow. The recent release supports choosing Envalid today, while below-baseline adoption growth and concentrated release ownership limit confidence over two years.
- github.com/af/envalid/releases/tag/v9.0.0: Recent stable release with zero runtime dependencies.
- github.com/kgoedecke/doop/blob/main/server/env.ts: Direct example of typed startup checks in a downstream service.
- env.t3.gg/docs/introduction: Peer covers separate client and server validation.
- varlock.dev/guides/secrets: Peer combines schema validation with secret provider integration.
- npm downloadsLast4Weeks, npm downloadsSame4WeeksYearAgo and medianDownloadsRatio: Envalid trails the catalog's growth baseline.
Needed by many6.2
How many developers need a tool for this job?
Claude Opus 5.5: 6.0, likely 5.0 to 7.0
Most server-side JS/TS apps read environment variables and benefit from checking them. envalid covers only the validation half of the job and works best on servers. It has no special support for frontend frameworks, so it is narrower than the whole category.
- pkgpulse.com/guides/best-env-variable-management-nodejs-2026: Recommended for Express, Fastify and Hono servers, not Next.js
- github description: Env validation for Node, Bun and compatible runtimes
GPT-6.2 Sol: 6.3, likely 5.1 to 7.5
Checking settings at startup serves a large group of backend and CLI developers, and Envalid works across frameworks on Node.js and Bun. Its audience is narrower than the full config category because loading files and fetching secrets happen upstream. Runtime surveys show how common those platforms are, but give little evidence about how many projects need a dedicated validator.
- 2025.stateofjs.com/en-US/other-tools/#runtimes: Node.js and Bun are widely used among respondents.
- github.com/af/envalid: Accepts an environment object and documents separate file loading.
- nodejs.org/api/environment_variables.html: Node.js can load .env files directly.
Helps a lot6.9
How well does it do the job for those who need it?
Claude Opus 5.5: 6.0, likely 5.0 to 7.0
envalid does validation well, with built-in validators, type inference, readable errors and new options such as requiredWhen and testDefault. It does not accept Standard Schema validators, has no framework presets, does no client/server split and does not load .env files, all of which T3 Env, Varlock and dotenvx offer in some form. Its API is small and stable, so AI agents usually write correct code for it.
- arkenv.js.org/docs/arkenv/comparison: No Standard Schema, no framework plugins, no secret masking
- github.com/af/envalid/releases: v8.1 added requiredWhen; v9 treats empty strings as missing
- dev.to/ctrotech/ctroenv-vs-zod-envalid-t3-env-which-env-validator-should-you-use-4aln: Described as a simple API with clear errors
- npm hasTypes: Ships its own TypeScript types
GPT-6.2 Sol: 7.8, likely 6.7 to 8.8
Version 9 infers types, converts common values, and reports missing and invalid settings together. A small API and clear examples make basic setup straightforward for developers and coding agents. Strict numeric parsing takes a custom validator, and T3 Env offers stronger support for shared client and server configuration. Comparative performance and agent accuracy remain unmeasured in the available evidence.
- github.com/af/envalid: Documents inference, defaults, and custom validators and reporters.
- raw.githubusercontent.com/af/envalid/v9.0.0/src/validators.ts: The number validator uses permissive prefix parsing.
- raw.githubusercontent.com/af/envalid/v9.0.0/src/reporter.ts: The default reporter groups missing and invalid variables.
- github.com/kgoedecke/doop/blob/main/server/env.ts: A downstream server uses Envalid with custom parsing and reporting.
- env.t3.gg/docs/introduction: T3 Env separates client and server variables and supports Standard Schema.
Holds up over time6.4
Will it still be a good choice in two years?
Claude Opus 5.5: 6.0, likely 4.5 to 7.5
The project is still actively maintained. It had 27 commits and 3 releases in the last year, v9.0.0 shipped in October 2026, and only 4 issues are open. Most of the work comes from one maintainer with no visible funding, and the v9 breaking changes (ESM-only, Node 22 minimum) may slow upgrades. Its 14-year history and careful beta-then-release pattern help, but the ecosystem is moving toward Standard Schema tools.
- github commitsLastYear / releasesLastYear: 27 commits, 3 releases
- github openIssues / closedIssues: 4 open vs 104 closed
- github.com/af/envalid/releases: v9: ESM-only, Node 22+, testOnly removed
- af/envalid maintainers: Mostly maintained by one person
GPT-6.2 Sol: 6.8, likely 5.4 to 8.0
Envalid had 27 commits, two stable npm releases, and a small open backlog over the latest year. A user-reported QuickJS issue led to a fix and documentation within weeks, although some other requests have been open for years. Releases still center on one maintainer in the public record, and v9 changed module packaging and blank-value handling. Confirmed funding and backup release authority would make the two-year outlook clearer.
- github commitsLastYear, openIssues, openPullRequests and npm versionsLastYear: 27 commits, four open issues, two open PRs, and two stable npm releases.
- github.com/af/envalid/releases: Release history shows one visible release lead and multiple code contributors.
- github.com/af/envalid/issues/253: Maintainer merged a user's QuickJS compatibility fix in September.
- github.com/af/envalid/issues: Several requests about defaults and output behavior remain open.
Used widely4.4
How many use it, and is that growing?
Claude Opus 5.5: 5.0, likely 4.0 to 6.0
envalid had about 4.5M downloads in 4 weeks and 2,933 dependent repos, a solid mid-sized base. Its year-over-year ratio of 2.7 is below the 4.1 median, while T3 Env grew 7x, dotenvx 21x and Varlock from almost nothing. Its share of new projects is shrinking.
- npm downloadsLast4Weeks / downloadsSame4WeeksYearAgo: 4.47M vs 1.65M, ratio 2.7 below median 4.1
- dependents: 2,933 repos and 373 packages, close to T3 Env and convict
- bluesky posts / hackerNews stories: Zero posts and zero stories
GPT-6.2 Sol: 3.8, likely 2.8 to 5.1
The 2,933 indexed repositories and 373 npm packages put Envalid near Convict and T3 Env by observed use. Downloads rose from 1.65 million to 4.47 million, but that 2.71× increase fell below the 4.1× catalog median and T3 Env's 7.19×. Its 1,590 stars and quiet social snapshot add little evidence of fresh adoption. The dependency index misses projects and npm counts repeated installs, leaving the total number of direct choices uncertain.
- dependents: 2,933 repositories and 373 npm packages in the index.
- npm downloadsLast4Weeks, npm downloadsSame4WeeksYearAgo and medianDownloadsRatio: 2.71× download growth against a 4.1× baseline.
- peers: Convict has 2,529 indexed repositories and T3 Env has 3,482.
- github stars, hackerNews stories and bluesky posts: 1,590 stars and no matched stories or posts.
Vouched for4.5
Who stands behind it being good?
Claude Opus 5.5: 4.0, likely 3.0 to 5.5
Third-party guides call it battle-tested and a good pick for plain servers, and many packages depend on it. I found no current survey data, no framework that builds on it and no named large company backing it. Community attention on Hacker News and Bluesky is nil.
- arkenv.js.org/docs/arkenv/comparison: A competitor calls it battle-tested
- pkgpulse.com/guides/best-env-variable-management-nodejs-2026: Older but solid; t3-env is the default recommendation
- dependents packages: 373 npm packages depend on it
GPT-6.2 Sol: 5.0, likely 3.6 to 6.3
Doop uses Envalid at server startup, and a separate user reports using it to stop misconfigured Kubernetes pods before they become ready. The Zenvalidate author reports years of use and identifies reusable Zod schemas and client/server separation as reasons to switch. These are concrete examples, with limited evidence from large production deployments, satisfaction surveys, or current comparative benchmarks.
- github.com/kgoedecke/doop/blob/main/server/env.ts: Downstream application validates server settings at boot.
- github.com/af/envalid/issues/253: User reports deployment-time validation in Kubernetes.
- github.com/jshimko/zenvalidate#why-another-env-validation-library: Longtime user's comparison identifies two practical gaps.
- github.com/kriasoft/envars: Separate environment loader shows Envalid as a validation option.
Safe7.4
How safe is it to depend on?
Claude Opus 5.5: 8.0, likely 7.0 to 9.0
It has no runtime dependencies, no advisories ever, an MIT licence, and npm trusted publishing from GitHub workflows since v9. The Scorecard is 6.3, with weak code review, no branch protection and no security policy, which reflects a single maintainer pushing directly. The attack surface is small.
- npm dependencies: 0 runtime dependencies
- advisories total: No known advisories
- scorecard: 6.3; Code-Review 1, Branch-Protection 0, Security-Policy 0
- github.com/af/envalid/releases: v9 uses trusted publishing; tslib removed
GPT-6.2 Sol: 6.7, likely 5.5 to 7.9
The MIT license, zero runtime dependencies, and npm trusted publishing keep the package's supply-chain exposure relatively small. OSV records zero advisories, so there is little evidence on how quickly security fixes would ship. The 6.3 OpenSSF Scorecard flags weak code review and gives zero for branch protection, a security policy, and fuzzing. Some built-in validators include rejected values in errors that the default reporter logs, which matters when those values contain secrets.
- npm dependencies and license: Zero runtime dependencies and a permissive MIT license.
- advisories and scorecard: Zero OSV advisories and weak repository safeguards.
- github.com/af/envalid/releases/tag/v9.0.0: v9 enabled npm trusted publishing from GitHub workflows.
- raw.githubusercontent.com/af/envalid/v9.0.0/src/validators.ts: Several built-in validators include rejected input in error text.
- raw.githubusercontent.com/af/envalid/v9.0.0/src/reporter.ts: The default reporter writes validation error text to stderr.
Good
- It has zero runtime dependencies, and since v9 it is published through npm trusted publishing.
- Its built-in validators, defaults, testDefault and choices options cover most server needs with very little code.
- Error messages are readable, a reporter can be swapped in, and the docs option links each variable to its documentation.
- It is written in TypeScript and infers the type of the cleaned env object from the spec.
Bad
- It does not support Standard Schema, Zod or Valibot, and it has no client/server split for Next.js, Vite or Nuxt.
- v9 is ESM-only and needs Node 22 or later, which breaks older CommonJS setups.
- It does not load .env files or manage secrets, so you still need dotenv or a runtime loader.
- One maintainer does most of the work, and branch protection and code review are weak.
The numbers
- npm downloads, 4 weeks
- 4.5M ×2.7 in a year
- GitHub stars
- 1.6k
- Commits, 12 months
- 27
- npm version
- 9.0.0 Oct 2026
- Versions, 12 months
- 2
- Advisories, 24 months
- 0 of 0 ever
- OpenSSF Scorecard
- 6.3 out of 10, Nov 2026
- Licence
- MIT
Read on 21 November 2026 from GitHub (af/envalid), npm (envalid), OSV and the OpenSSF Scorecard.