# @swift-rust/env

> Loads .env files and exposes validated environment variables.

Latest version **0.2.2** (published 2026-10-17) · MIT license · 0 weekly downloads

## Install

```sh
npm install @swift-rust/env
pnpm add @swift-rust/env
yarn add @swift-rust/env
bun add @swift-rust/env
```

## Health

**Score 70/100 (B)** — status: active.

Positive: has types; esm support; no vulnerabilities; recently updated; high maintenance score; high quality score.

Warnings: low downloads; pre 1.0.

## Facts

| | |
|---|---|
| Version | 0.2.2 |
| Published | 2026-10-17 |
| First published | 2026-06-03 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 1 |
| Unpacked size | 5.4 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 3 |
| Maintainers | cole5689 |

## Links

- npm: https://www.npmjs.com/package/@swift-rust/env
- Repository: https://github.com/colesites/swift-rust
- Homepage: https://swift-rust.dev
- Issues: https://github.com/colesites/swift-rust/issues
- npm.io page: https://npm.io/package/@swift-rust/env

## Dependencies (1)

- [@dotenvx/dotenvx](https://npm.io/package/@dotenvx/dotenvx.md) ^2.38.0

## Recent versions

- 0.2.2 (latest) — 2026-10-17
- 0.2.1 — 2026-10-17
- 0.2.0 — 2026-06-03

## README

# @swift-rust/env

Loads `.env*` files into `process.env` at server startup and provides helpers for the `SWIFT_RUST_PUBLIC_*` convention used to expose safe-to-inline values to client code.

## Usage

```ts
import { loadPublicEnv, publicEnvKey } from "@swift-rust/env";

loadPublicEnv();
// or
import { loadEnvFiles } from "@swift-rust/env/load";
loadEnvFiles();
```

---
_Source: https://npm.io/package/@swift-rust/env · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
