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

slopenv-expand

v1.0.1

Published

Sensible environment variable loading for monorepos with variables expansion.

Readme

slopenv-expand

Sensible environment variable loading for monorepos with variables expansion.

Overview

slopenv-expand is a CLI tool that combines the power of slopenv for intelligent environment variable loading in monorepos with dotenv-expand for variable expansion support.

It provides a simple way to load environment variables from multiple .env files following a sensible precedence order, expand variables within those files, and then execute any command with the loaded environment.

Features

  • Monorepo-aware: Loads environment variables from multiple .env files following a sensible precedence order
  • Variable expansion: Supports expanding variables within .env files (e.g., DATABASE_URL=postgres://${DB_USER}:${DB_PASSWORD}@localhost:5432/mydb)
  • Simple CLI: Run any command with pre-loaded environment variables
  • Zero configuration: Works out of the box with sensible defaults
  • TypeScript: Written in TypeScript with full type safety

Installation

npm install -g slopenv-expand

Or use with npx:

npx slopenv-expand <command>

Usage

slopenv-expand <command> [args]

Examples

Run a Node.js script with environment variables loaded:

slopenv-expand node server.js

Run npm scripts with environment variables:

slopenv-expand npm run dev

Run any command with environment variables:

slopenv-expand python script.py
slopenv-expand go run main.go
slopenv-expand docker-compose up

How It Works

  1. Loads environment variables using slopenv which follows this precedence order:

    • System environment variables (highest priority)
    • .env.local (for local overrides)
    • .env.development, .env.test, .env.production (based on NODE_ENV)
    • .env (base file)
  2. Expands variables using dotenv-expand, allowing you to reference other variables:

    DB_USER=admin
    DB_PASSWORD=secret
    DATABASE_URL=postgres://${DB_USER}:${DB_PASSWORD}@localhost:5432/mydb
  3. Executes your command with the loaded environment variables

Environment File Examples

Basic .env file

PORT=3000
DATABASE_URL=postgres://localhost:5432/mydb
API_KEY=your-api-key-here

With variable expansion

DB_HOST=localhost
DB_PORT=5432
DB_NAME=mydb
DATABASE_URL=postgres://${DB_HOST}:${DB_PORT}/${DB_NAME}

Environment-specific files

  • .env.development - Development-specific variables
  • .env.test - Test-specific variables
  • .env.production - Production-specific variables
  • .env.local - Local overrides (gitignored by default)

Comparison with Other Tools

| Feature | slopenv-expand | dotenv | dotenv-expand | slopenv | | -------------------------- | -------------- | ------ | ------------- | ------- | | Monorepo support | ✅ | ❌ | ❌ | ✅ | | Variable expansion | ✅ | ❌ | ✅ | ❌ | | Environment-specific files | ✅ | ✅ | ❌ | ✅ | | CLI interface | ✅ | ❌ | ❌ | ✅ | | Zero configuration | ✅ | ❌ | ❌ | ✅ |

Development

Prerequisites

  • Node.js >= 20
  • npm

Setup

git clone https://github.com/shurizzle/slopenv-expand.git
cd slopenv-expand
npm install

Build

npm run build

Development mode

npm run dev

Code Quality

npm run check        # Run format, lint, and type checks
npm run format       # Format code
npm run lint         # Lint code
npm run typecheck    # Type check

License

MIT © 2026 shurizzle