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

@marcuwynu23/vite-plugin-env-banner

v1.0.0

Published

A Vite plugin that shows a floating environment badge to help developers identify the current app environment.

Downloads

129

Readme

The banner is intentionally disabled when the resolved environment is production.

Why use this plugin

  • Reduce deployment mistakes by making environment context obvious.
  • Keep QA/UAT demos clear with visible DEVELOPMENT / STAGING labels.
  • Move the badge anywhere on screen when it overlaps UI controls.
  • Use zero runtime dependencies.

Features

  • Uses Vite's transformIndexHtml to inject the banner.
  • Draggable banner implemented with vanilla JavaScript.
  • Built-in color mapping:
    • development -> blue
    • staging -> orange
    • any other non-production value -> gray
  • Defaults to development when no value is resolved.
  • Skips injection entirely for production.
  • Supports explicit env source via env or envfile.

Installation

npm install @marcuwynu23/vite-plugin-env-banner

Quick Start

import {defineConfig} from "vite";
import envBanner from "@marcuwynu23/vite-plugin-env-banner";

export default defineConfig({
  plugins: [envBanner()],
});

JavaScript config is also supported:

import {defineConfig} from "vite";
import envBanner from "@marcuwynu23/vite-plugin-env-banner";

export default defineConfig({
  plugins: [envBanner()],
});

Configuration

envBanner({
  env: "staging",
  envfile: "./config/.env.staging",
});

Options

| Option | Type | Required | Description | | --------- | -------- | -------- | ----------------------------------------------------------------------------------------------- | | env | string | No | Hard override for the environment value (production, staging, etc.). | | envfile | string | No | Path to a specific env file to read VITE_APP_ENV from. Relative paths resolve from Vite root. |

Resolution precedence

The plugin resolves the final environment in this order:

  1. env option
  2. envfile value (VITE_APP_ENV key inside that file)
  3. Vite resolved env (VITE_APP_ENV)
  4. fallback: development

Environment Example

.env:

VITE_APP_ENV=development

When VITE_APP_ENV=production, the plugin returns HTML unchanged and injects nothing.

Example Project

A runnable Vite + React sample is included in example-react.

cd example-react
npm install
npm run dev

License

MIT