@julr/vite-plugin-validate-env weekly downloads statistics
By julr · npm · Vite plugins
✅ Vite plugin for validating your environment variables
@julr/vite-plugin-validate-env has 18,002 recorded weekly downloads on npm, a decrease of 54.6% over the past 30 days.
It ranks #779 of 2,251 tracked npm listings by weekly downloads.
Over 90 days, weekly downloads changed by -36.7%.
PluginStats has 543 daily observations since Apr 23, 2025; the latest is from Oct 17, 2026.
About @julr/vite-plugin-validate-env
vite-plugin-validate-env
A Vite plugin that validates your environment variables at build or dev time. This helps you catch misconfigurations early by failing fast. No more broken builds or 10 minutes of debugging just to realize you forgot a variable 🥲
✅ Features
• Validate environment variables at build time only, zero runtime overhead • Fully type-safe • Supports standard-schema — works with Zod, Valibot, ArkType, and more • Built-in parsing, validation, and transformation • Custom rules and error messages
Installation
Basic Usage
You can use the plugin with the built-in validator for simple use cases, or with libraries like Zod for more advanced schemas.
[!TIP] I would recommend using a dedicated env.ts file to keep your Vite config clean and separate from your environment variable definitions. See the Using a Dedicated env.ts Config File section for more details.
Built-in Validator
Standard Schema Validators
If you want to use Zod or another validator compatible with standard-schema, pass the validator and schema manually:
Built-in Validator Examples
Using Standard Schema
standard-schema provides a common interface for multiple validation libraries.
Here’s how to use it with Zod, Valibot, or ArkType, or any other library that supports it.
Using a Dedicated env.ts Config File
You can move your env definitions to a separate file like this:
Typing import.meta.env
In order to have a type-safe import.meta.env, the ideal is to use the dedicated configuration file env.ts. Once this is done, you would only need to add an vite-env.d.ts in src/ folder to augment ImportMetaEnv (as suggested here ) with the following content:
Validation without Vite
In some cases, you might want to validate environment variables outside of Vite and reuse the same schema. You can do so by using the loadAndValidateEnv function directly. This function will validate and also load the environment variables inside the process.env object.
[!WARNING] process.env only accept string values, so don't be surprised if a number or boolean variable comes back as a string when accessing it after validation.
💖 Sponsors
If you find this useful, consider sponsoring me! It helps support and maintain the project 🙏
License
MIT © Julien Ripouteau
Description from the npm listing.
- env
- env-var
- validation
- vite
- vite-plugin
- zod
Where @julr/vite-plugin-validate-env sits in the listing
Each band is one page of 20. Weekly downloads on a log scale. Placement is projected from weekly downloads, so it can differ from the marketplace's own sort order. Hover a dot to see the listing.
Charts
Images: 30d · 1y · all time · 1600×900 dark
Adoption over time
7/30/90-day growth
Filled points are observed values; hollow points come from Internet Archive snapshots of the listing page. Dashed segments span periods with no observations — values between points are not interpolated.
Recent observations
Full history (543)Similar npm Vite plugins plugins
Data source
Weekly downloads (trailing 7 complete days) come from the official npm downloads API. Downloads include CI and mirrors and are not equivalent to installs or users. npm publishes no ratings.
Listing: https://www.npmjs.com/package/@julr/vite-plugin-validate-env. First seen Oct 16, 2026; last successful collection Oct 18, 2026. See the methodology.