
Security News
Attackers Are Hunting High-Impact Node.js Maintainers in a Coordinated Social Engineering Campaign
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.
Universal environment variable loader and Vite plugin for Bini.js — works in Node.js, Deno, Bun, and Vite edge functions
Zero-config environment variable system + Vite plugin for Bini.js
Loads .env in development, uses host-provided variables in production, and works across Node.js, Bun, Deno, and edge runtimes — without leaking secrets or adding runtime cost.
This library does NOT magically make env vars safe.
import.meta.env) is public.getEnv, requireEnv) can safely access secrets.If you don’t understand this, stop and fix that first.
getEnv() / requireEnv() work across runtimes.env loading in developmentBINI_, VITE_, or custompnpm add bini-env
# or
npm install bini-env
# or
yarn add bini-env
// vite.config.ts
import { defineConfig } from 'vite';
import { biniEnv } from 'bini-env';
export default defineConfig({
plugins: [biniEnv()]
});
Done.
If this doesn’t work, your project setup is broken — not the plugin.
✅ Good news: Both
BINI_andVITE_prefixes work out of the box — no extra config needed.
BINI_PUBLIC_API_URL=https://api.example.com
VITE_ANALYTICS_ID=UA-XXXX
Accessible via:
import.meta.env.BINI_PUBLIC_API_URL
👉 Never put secrets here. Ever.
SMTP_PASS=super_secret
DATABASE_URL=postgres://...
import { requireEnv } from 'bini-env';
const pass = requireEnv('SMTP_PASS');
👉 If this leaks, it’s your fault, not the library’s.
| Mode | Behavior |
|---|---|
Dev (vite dev) | Loads .env once via dynamic dotenv |
| Preview | Same as dev |
| Production | Uses process.env / host injection only |
| Edge/Deno | Uses native Deno.env |
No runtime branching in client bundles. No hidden magic.
biniEnv({
enabled: true,
clearViteHeader: true,
logo: 'ß',
envPrefix: ['BINI_', 'VITE_']
});
If you change envPrefix, you are changing what gets exposed to the browser.
Break this → you leak secrets.
getEnv(key)Returns string | undefined.
Safe fallback reader across:
Deno.envprocess.envimport.meta.envrequireEnv(key)Same as getEnv but throws:
[bini-env] Missing required environment variable: "SMTP_PASS"
Use this for anything critical.
biniEnv(options)Vite plugin.
If your plugin order is wrong and things break, that’s on your config.
.env.local.env.[mode].local.env.[mode].envLoaded once. Cached. No repeated disk reads.
| Metric | Dev | Prod |
|---|---|---|
| File Reads | 1–5 | 0 |
| Runtime Cost | ~5ms once | 0 |
| Bundle Impact | Minimal | Tree-shaken |
If you see overhead in production, you did something wrong.
You forgot the prefix.
You relied on .env in production.
You exposed them via prefix.
Add:
/// <reference types="vite/client" />
This library is intentionally simple.
If you need:
That’s your job, not this package.
PRs welcome — but:
If it slows startup or increases bundle size, it’s getting rejected.
MIT © Bini.js Team
Ship fast. Leak nothing. Blame config, not tooling.
FAQs
Universal environment variable loader and Vite plugin for Bini.js — works in Node.js, Deno, Bun, and Vite edge functions
The npm package bini-env receives a total of 258 weekly downloads. As such, bini-env popularity was classified as not popular.
We found that bini-env demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.