0.1.5 • Published 5 months ago

ark.env v0.1.5

Weekly downloads
-
License
MIT
Repository
github
Last release
5 months ago

Installation

npm install ark.env arktype
pnpm add ark.env arktype
yarn add ark.env arktype
bun add ark.env arktype

Quickstart

!TIP Find more examples in the examples directory.

import ark, { host, port } from 'ark.env';

const env = ark.env({
  HOST: host, // valid IP address or localhost
  PORT: port, // valid port number (0-65535)
  NODE_ENV: "'development' | 'production' | 'test'",
});

// Automatically validate and parse process.env
// TypeScript knows the ✨exact✨ types!
console.log(env.HOST);     // (property) HOST: string
console.log(env.PORT);     // (property) PORT: number
console.log(env.NODE_ENV); // (property) NODE_ENV: "development" | "production" | "test"

Features

  • 🔒 Typesafe: Full TypeScript support with inferred types
  • 🚀 Runtime validation: Catch missing or invalid environment variables early
  • 💪 Powered by ArkType: Leverage ArkType's powerful type system
  • 🪶 Lightweight: Only a single dependency (5.6 kB)
  • Fast: Optimized for performance with minimal overhead

Documentation

For detailed documentation and examples, please visit our documentation site.

Contributing

Contributions are welcome! Please see CONTRIBUTING.md for more information.

Thanks / Inspiration

Find projects and people who helped or inspired the creation of ark.env in THANKS.md. Thank you 🙏

0.1.5

5 months ago

0.1.4

5 months ago

0.1.3

5 months ago

0.1.0

5 months ago

0.1.2

5 months ago

0.1.1

5 months ago

0.0.5

5 months ago

0.0.4

5 months ago

0.0.3

6 months ago

0.0.2

6 months ago

0.0.1

6 months ago

0.0.0

6 months ago