Skip to content

πŸ” Secure & validate your ".env" files with encryption, schema validation, and CLI tools. Think of it as dotenv on steroids β€” with extra guardrails for production-ready apps.

License

Notifications You must be signed in to change notification settings

ibnushahraa/dotenv-guard

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

49 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

dotenv-guard

npm version npm downloads Bundle Size license CI Known Vulnerabilities Security

πŸ” Secure & validate your .env files with encryption, schema validation, and CLI tools. Think of it as dotenv on steroids β€” with guardrails for production-ready apps.


πŸ“¦ Packages

This is a monorepo containing:


✨ What Makes It Different?

πŸ” Security First

  • AES-256-GCM Encryption with authenticated encryption
  • Zero-config master key generation (no native dependencies!)
  • Selective encryption - choose what to encrypt via env.enc.json
  • Built-in migration tools from legacy formats

βœ… Production Ready

  • Schema validation with regex, enums, and required fields
  • Multi-framework support (Node.js, Vite, Nuxt)
  • Auto mode detection (development/production)
  • Cross-platform - works on Windows/macOS/Linux/Docker

πŸš€ Developer Experience

  • CLI tools for quick setup and management
  • Drop-in replacement for dotenv (no breaking changes)
  • TypeScript definitions included
  • 109 tests across all packages

πŸš€ Quick Start

For Node.js / Express / NestJS

npm install @ibnushahraa/dotenv-guard
import { config } from "@ibnushahraa/dotenv-guard";
config({ validator: true });

β†’ Full Core Documentation


For Vite / Vue / React

npm install @ibnushahraa/vite-plugin-dotenv-guard
// vite.config.js
import dotenvGuard from '@ibnushabraa/vite-plugin-dotenv-guard';

export default defineConfig({
  plugins: [dotenvGuard({ validator: true })]
});

β†’ Full Vite Plugin Documentation


For Nuxt 3

npm install @ibnushahraa/nuxt-dotenv-guard
// nuxt.config.ts
export default defineNuxtConfig({
  modules: ['@ibnushahraa/nuxt-dotenv-guard'],
  dotenvGuard: {
    validator: true
  }
});

β†’ Full Nuxt Module Documentation


πŸ’‘ Why dotenv-guard?

Feature dotenv dotenv-guard
Load .env files βœ… βœ…
Encryption ❌ βœ… AES-256-GCM
Zero native deps βœ… βœ… Built-in crypto
Selective encryption ❌ βœ… Config-based
Schema validation ❌ βœ… Regex + Enum
Multi-environment ❌ βœ… Auto-load
CLI tools ❌ βœ… Full-featured
Vite plugin ❌ βœ… First-class
Nuxt module ❌ βœ… Auto mode detection
Cross-platform βœ… βœ… No build required

Not a replacement for dotenv β†’ a secure extension for production apps.


πŸ§ͺ Development

This is a monorepo managed with npm workspaces.

# Install dependencies
npm install

# Run all tests
npm test

# Test specific package
npm run test:core
npm run test:vite-plugin
npm run test:nuxt-module

πŸ“– Documentation


🀝 Contributing

We welcome contributions! Please see CONTRIBUTING.md for guidelines.

Ways to contribute:

  • Report bugs and suggest features
  • Submit pull requests
  • Improve documentation
  • Develop plugins for other frameworks

πŸ“„ License

MIT Β© 2025

About

πŸ” Secure & validate your ".env" files with encryption, schema validation, and CLI tools. Think of it as dotenv on steroids β€” with extra guardrails for production-ready apps.

Topics

Resources

License

Contributing

Stars

Watchers

Forks

Packages

No packages published

Contributors 2

  •  
  •