npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

dotlyte

v0.1.2

Published

The universal .env and configuration library. One API for every language.

Readme

dotlyte — JavaScript / TypeScript

The universal .env and configuration library for JavaScript and TypeScript.

Installation

npm install dotlyte
# or
pnpm add dotlyte
# or
yarn add dotlyte

Quick Start

import { load } from "dotlyte";

const config = load();

config.port;           // automatically number
config.debug;          // automatically boolean
config.database.host;  // dot-notation access

Features

  • ESM + CJS dual builds via tsup
  • Zero-config startload() with no arguments
  • .env file loading — auto-detects .env, .env.local, .env.{env}
  • YAML, JSON, TOML support
  • Type coercion"true"true, "8080"8080
  • Dot-notation accessconfig.database.host
  • TypeScript first — full type safety
  • Typed configcreateTypedConfig() with generic inference, Zod/Valibot support
  • Server/client boundaries — Proxy-based enforcement for SSR frameworks
  • Next.js runtime provider — solve Docker + NEXT_PUBLIC_* at runtime
  • Generic SSR runtime — SvelteKit, Nuxt, Astro runtime env injection
  • Encryption & masking — key rotation, vault workflows, audit proxies
  • CLI tooldotlyte check, diff, generate-types, encrypt, doctor, init
  • Monorepo support — pnpm/turbo/nx/lerna workspace detection

API

load(options?) → Config

| Option | Type | Description | |---|---|---| | files | string[] | Explicit files to load | | prefix | string | Strip env var prefix | | defaults | Record<string, unknown> | Default values | | sources | string[] | Custom source order | | env | string | Environment name |

Config

| Method | Description | |---|---| | config.key | Dot-notation access | | config.get(key, default?) | Safe access with fallback | | config.require(key) | Throws DotlyteError if missing | | config.toObject() | Convert to plain object | | config.has(key) | Check if key exists |

createTypedConfig(schema, options?) → Config

TypeScript-first validated config with schema inference:

import { createTypedConfig } from "dotlyte";

const env = createTypedConfig({
  PORT: { type: "integer", default: 3000 },
  DEBUG: { type: "boolean", default: false },
  DATABASE_URL: { type: "string", format: "url", required: true },
  LOG_LEVEL: { type: "string", enum: ["debug", "info", "warn", "error"] as const },
});

env.PORT;          // number
env.DEBUG;         // boolean
env.DATABASE_URL;  // string (required — never undefined)
env.LOG_LEVEL;     // 'debug' | 'info' | 'warn' | 'error'

Supports sectioned schemas for server/client boundary enforcement:

const env = createTypedConfig({
  server: {
    DATABASE_URL: { type: "string", required: true },
  },
  client: {
    NEXT_PUBLIC_APP_URL: { type: "string", format: "url" },
  },
  shared: {
    NODE_ENV: { type: "string", enum: ["development", "test", "production"] as const },
  },
  clientPrefix: "NEXT_PUBLIC_",
});

Subpath Exports

| Import | Description | |---|---| | dotlyte/next | DotlyteProvider, withDotlyte, extractClientEnv, getClientEnv, generateRuntimeEnv | | dotlyte/ssr | createRuntimeScript, getRuntimeEnv, getClientSafeEnv | | dotlyte/zod | withZod() adapter | | dotlyte/valibot | withValibot() adapter |

Next.js Runtime Provider

// app/layout.tsx
import { DotlyteProvider } from "dotlyte/next";

export default function RootLayout({ children }) {
  return (
    <html>
      <head>
        <DotlyteProvider env={process.env} clientPrefix="NEXT_PUBLIC_" />
      </head>
      <body>{children}</body>
    </html>
  );
}

CLI

npx dotlyte check          # Validate env against schema
npx dotlyte diff           # Compare .env files
npx dotlyte generate-types # Generate TypeScript declarations
npx dotlyte encrypt        # Encrypt sensitive values
npx dotlyte doctor         # Diagnose config issues
npx dotlyte init           # Initialize dotlyte project

License

MIT