一覧へ戻る
yamcodes/arkenv(新しいタブで開きます)
主要言語: TypeScript
⛯ Typesafe environment variables with ArkType, Zod, or Valibot.
- star 数
- 151
- watcher 数
- 1
- fork 数
- 6
- issue 数
- 7
- 最終更新
- 2026/10/30
主要言語: TypeScript
⛯ Typesafe environment variables with ArkType, Zod, or Valibot.
Typesafe environment variables with ArkType, Zod, or Valibot.
ArkEnv v1 is in RC. Read the release notes and migration guide.
Define your environment variables with a schema. ArkEnv gives you a strongly typed, validated env object you can use everywhere.
import arkenv from "@arkenv/core"; export const env = arkenv({ DATABASE_URL: "string.url", PORT: "0 <= number.integer <= 65535 = 3000", CI: "boolean = false", });
import arkenv from "@arkenv/standard"; import * as z from "zod"; export const env = arkenv({ DATABASE_URL: z.url(), PORT: z.int().min(0).max(65535).default(3000), CI: z.boolean().default(false), });
import arkenv from "@arkenv/standard/valibot"; import * as v from "valibot"; export const env = arkenv({ DATABASE_URL: v.pipe(v.string(), v.url()), PORT: v.optional( v.pipe(v.number(), v.integer(), v.minValue(0), v.maxValue(65535)), 3000, ), CI: v.optional(v.boolean(), false), });
| ArkEnv | Instead of |
|---|---|
| Your existing TypeScript validator | A custom .env.schema DSL |
arkenv({ ... }) |
A hand-rolled wrapper around Zod |
One typed env object |
Casting process.env |
env object: Next.js, Nuxt, Vite, TanStack Start, SolidStart, and Bunnpx arkenv init
The CLI walks you through setup for an existing project, or starts a new one from an example.
If you love ArkEnv, you can support the project by starring it on GitHub!
You are also welcome to contribute to the project and join the wonderful people who have contributed:
Yam C Borodetsky 💻 💬 🤔 🎨 📖 🐛 💡 🚇 🔌 🔧 ⚠️ |
Aruay Berdikulova 💻 🤔 |
David Blass 🤔 🧑🏫 💬 |
Andrei Danciu 🔌 💻 |
Joakim Carlstein 💻 🔌 📖 |
RoomWithOutRoof 📖 🔧 |
Abhimanyu Tiwari 💻 📖 💡 ⚠️ 🔧 |
We acknowledge the various projects and people that inspired ArkEnv.