Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.envless.cloud/llms.txt

Use this file to discover all available pages before exploring further.

Install

bun add @goenvless/envless
Add the loader to your bunfig.toml:
bunfig.toml
preload = ["@goenvless/envless/register"]
Now every bun run and bun test boots with variables already populated, no source changes required.

Direct import

If you prefer code-side:
server.ts
import '@goenvless/envless/register';
import { serve } from 'bun';

serve({ port: env.PORT, fetch: handler });

Use it

import { env } from '@goenvless/envless/server';

const db = new Bun.SQL(env.DATABASE_URL);

Bun-specific notes

  • Bun.env is populated alongside process.env.
  • Native crypto is used (no polyfill).
  • Cold start is ~2–4ms faster than Node thanks to Bun’s import cache.