Installation
Add @vlandoss/env to a project, install the peer dependencies you need, and pick which runtime entrypoints to import.
Install the package
pnpm add @vlandoss/envPick a schema validator
@vlandoss/env is agnostic to the schema validator — the core relies on Standard Schema, so any Standard Schema–compatible validator works (Zod, Valibot, ArkType, …). Install the one you'll actually use; you don't need any of them if you're plugging in your own.
The docs and the opt-in primitives at @vlandoss/env/zod are written against Zod, so it's the most common pick:
pnpm add zodPeer dependencies
Peers are optional — install only the ones whose entrypoints you import:
| If you import… | Install |
|---|---|
@vlandoss/env/zod | zod@^4 |
@vlandoss/env/vite | vite@>=5 |
@vlandoss/env/react | react@>=19, react-dom@>=19 |
@vlandoss/env/fs | (none — Node-compat built-ins) |
Available entrypoints
The package is split into a small set of entrypoints, each with its own page in the API reference — signatures, options, return types, and examples:
| Entrypoint | Reference |
|---|---|
@vlandoss/env | Core |
@vlandoss/env/fs | Filesystem |
@vlandoss/env/vite | Vite |
@vlandoss/env/react | React |
@vlandoss/env/zod | Zod primitives |
Next
Go to Quickstart for a minimal Node example, or jump to Concepts for the mental model.
Introduction
Contract-first environment configuration with typed schemas. Define your env once with Standard Schema, merge per-environment config with your environment variables, and read typed values in your code.
Quickstart
Wire a typed env in a Node app in under five minutes — schema, per-environment config files, and a validated env object you can import anywhere.