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

env-flag

v1.1.1

Published

A lightweight environment flag indicator for browser apps.

Readme

🚩 env-flag

A premium, ultra-lightweight environment indicator for browser applications. Distinguish between DEV, STAGING, and PROD instantly with badges and screen frames.

Environment Flag Example

npm version bundle size license


✨ Why env-flag?

Ever accidentally ran a destructive script on a Production database thinking it was Development? env-flag prevents "environment confusion" by giving you high-visibility visual cues that are impossible to miss, yet zero-impact on your app's performance.

  • 🚀 Ultra-Small: Only ~2.5KB minified. Zero dependencies.
  • 🖼️ Visual Safety: Full-screen frame indicator for instant recognition.
  • Performance First: Optimized DOM operations and pointer-events: none ensures no interaction lag.
  • 🧠 Auto-Detection: Works out-of-the-box with Vite, Webpack, Next.js, and Create React App.
  • 🎨 Fully Customizable: Match your brand or stick with our premium defaults.

🚀 Features

  • [x] Automatic environment detection (Node, Vite, React, Vue, or Hostname).
  • [x] Screen Frame: A colored border around your entire viewport (Safe & Fast).
  • [x] Minimal Badge: A subtle, customizable badge in any corner.
  • [x] Smart Styling: Zero Layout Shift (ZLS) design.
  • [x] TypeScript Native: Full type safety included.

📦 Installation

npm install env-flag
# or
yarn add env-flag
# or
pnpm add env-flag

🛠️ Getting Started

1. Basic Setup

Just import and initialize. It will try to detect your environment automatically.

import EnvFlag from "env-flag";

const flag = new EnvFlag();
flag.init();

2. Advanced Configuration

Customize colors, thickness, and visibility.

const flag = new EnvFlag({
  position: "top-left",
  showFrame: true, // Enable the full screen border
  frameWidth: "6px", // Frame thickness
  developmentColor: "#00D1FF",
  productionText: "⚠️ LIVE SYSTEM",
  size: "large",
});

flag.init();

⚙️ Configuration Options

| Option | Type | Default | Description | | ------------------ | --------- | -------------- | ------------------------------------------ | | enabled | boolean | true | Show/hide the flag entirely. | | showFrame | boolean | true | Show a colored frame around the screen. | | frameWidth | string | 4px | Thickness of the screen frame. | | productionColor | string | #f8285a | Color for Production environment. | | developmentColor | string | #17c653 | Color for Development environment. | | stagingColor | string | #f39c12 | Color for Staging environment. | | testColor | string | #9b59b6 | Color for Test environment. | | position | string | bottom-right | Badge corner position (see below). | | size | string | medium | Badge size (small, medium, large). | | autoDetectEnv | boolean | true | Try to detect env via bundler or hostname. | | forceEnv | string | undefined | Manually override detection. |

Valid Positions

top-right | top-left | bottom-right | bottom-left


🛡️ Performance Note

The screen frame uses box-shadow: inset and pointer-events: none. This means:

  1. It does not affect your layout (won't push elements).
  2. It does not block clicks (you can click buttons "under" the frame).
  3. It has zero GPU impact during scrolling.

🧑‍💻 Contributing

Contributions are welcome! If you find a bug or have a feature request, please open an issue.

📄 License

ISC © Koray TUNCER