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 🙏

© 2025 – Pkg Stats / Ryan Hefner

@envin/cli

v1.1.12

Published

Type-safe env validation with live previews

Readme

Envin

Installation

[!NOTE]

This is an ESM only package that requires a tsconfig with a module resolution that can read package.json#exports (NodeNext if transpiling with tsc, Bundler if using a bundler).

# Core package, no framework specific features
bun add envin

# CLI, used e.g. for live previews
bun add @envin/cli

For full documentation, see https://envin.turbostarter.dev

Usage

[!NOTE]

You may use any Standard Schema compliant validator of your choice.

This package supports the full power of most popular schema libraries, meaning you can use transforms and default values.

Define your schema

// env.config.ts
import { defineEnv } from "envin";
import * as z from "zod"; 

export default defineEnv({
  /*
   * Shared environment variables, available on the client and server.
   */
  shared: {
    NODE_ENV: z.enum(["development", "production"]).default("development"),
  },
  /*
   * Prefix for client environment variables.
   */
  clientPrefix: "NEXT_PUBLIC_",
  /*
   * Environment variables available on the client (and server).
   *
   * 💡 You'll get type errors if these are not prefixed with NEXT_PUBLIC_.
   */
  client: {
    NEXT_PUBLIC_API_URL: z.url(),
  },
  /*
   * Serverside Environment variables, not available on the client.
   * Will throw if you access these variables on the client.
   */
  server: {
    DATABASE_URL: z.url(),
  },
  /*
   * In some cases, we need to manually destructure environment variables to make sure all are included in bundle.
   *
   * 💡 You'll get type errors if not all variables are included here.
   */
  envStrict: {
    DATABASE_URL: process.env.DATABASE_URL,
    NEXT_PUBLIC_API_URL: process.env.NEXT_PUBLIC_API_URL,
  },
});

Use the schema in your app with autocompletion and type inference

// route.ts
import env from "~/env.config";

export const GET = (req: Request) => {
  const DATABASE_URL = env.DATABASE_URL;
  // use it...
};

Live Preview

One of the most powerful features of this package is the ability to preview your environment variables in a livemode.

# Run the CLI with your env.config.ts file
npx @envin/cli@latest dev

Live Preview

This will start a live preview server that will automatically update your environment variables when you change them allowing you to find and fix errors before deploying your app.

Contributing

See CONTRIBUTING.md.