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

envdotx

v1.0.1

Published

A hyper-lightweight, multi-runtime `.env` loader and CLI.

Readme

envdotx

A hyper-lightweight, multi-runtime .env loader and CLI.

Clocking in at just ~1.1KB, envdotx automatically detects your JavaScript environment (Node, Bun, or Deno) and uses the fastest native APIs available to load your environment variables. If native APIs aren't available, it falls back to a highly optimized custom parser.

Features

  • Universal Runtime: Works seamlessly across Node.js, Bun, and Deno.
  • Insanely Small: Zero dependencies, bundled and minified to ~1.1KB.
  • Native Speed: Uses built-in C++ loaders (like Node 20+ process.loadEnvFile or Bun.env) when possible for zero-overhead parsing.
  • Dual Purpose: Use it as a terminal CLI or import it as a library in your code.

Installation

Pick your favorite package manager:

npm install envdotx
# or
bun add envdotx
# or
yarn add envdotx

CLI Usage

You can use envdotx directly from your terminal to inject variables into other commands or inspect your .env file.

Run a command with environment variables injected:

npx envdotx run -- node server.js
# or with bun
bunx envdotx run -- bun run dev

List all parsed variables in a clean table:

npx envdotx list

Library Usage

You can import envdotx directly into your project. It automatically detects the runtime and applies the variables to process.env, Bun.env, or Deno.env accordingly.

loadEnv(options)

Loads the .env file into the global environment.

import { loadEnv } from "envdotx";

// Automatically loads variables from ./.env
await loadEnv();

console.log(process.env.MY_SECRET);

// You can also specify options:
await loadEnv({
  path: "./custom/.env.local",
  override: true, // Overwrite existing environment variables
});

parse(src)

If you just want to parse a string into an object without modifying the global environment, use the standalone parser.

import { parse } from "envdotx";
import { readFileSync } from "node:fs";

const raw = readFileSync(".env", "utf-8");
const config = parse(raw);

console.log(config); // { KEY: "VALUE" }

getRuntimeName()

Utility to check which runtime envdotx detected.

import { getRuntimeName } from "envdotx";

console.log(`Running on: ${getRuntimeName()}`); // 'node', 'bun', or 'deno'

License

MIT