New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details
Socket
Book a DemoSign in
Socket

envdoc

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

envdoc

Env Doctor: Diagnose, validate, and audit your .env files and environment variables in seconds.

latest
Source
npmnpm
Version
1.0.2
Version published
Maintainers
1
Created
Source

Env Doctor Logo

Env Doctor

Diagnose, validate, and audit your environment variables across your entire project.

Env Doctor scans all your .env files and your source code to catch missing and unused environment variables.

Features

  • Recursively finds all .env files in your project

  • Scans source files (.js, .ts, .jsx, .tsx, .mjs, .cjs)

  • Detects environment usage via:

    • process.env.KEY / process.env["KEY"]
    • import.meta.env.KEY
    • $env/static/* or astro:env/* imports
  • Reports missing and unused keys

  • Pretty output with spinners and colors

Installation

npm install -g envdoc

Usage

Run inside any project:

envdoc diagnose

That’s it — Env Doctor will automatically:

  • Find all .env files
  • Parse them
  • Scan your codebase for environment variable usage
  • Compare → Report missing & unused keys

Example

Project structure:

my-app/
 ├─ src/
 │   ├─ index.js
 │   └─ utils.ts
 ├─ .env
 └─ .env.local

.env file:

PORT=3000
DATABASE_URL=
DEBUG_MODE=true

src/index.js:

console.log(process.env.PORT);
console.log(process.env.DATABASE_URL);

Run:

envdoc diagnose

Output:

SUCCESS: Found 2 .env file(s).
SUCCESS: Parsed all .env files (3 unique keys found).
SUCCESS: Scan complete.

Used keys in code: [ 'PORT', 'DATABASE_URL' ]
Keys defined in .env files: [ 'PORT', 'DATABASE_URL', 'DEBUG_MODE' ]

WARNING: Missing keys in .env file(s): [ 'DATABASE_URL' ]
WARNING: Unused keys in .env file(s): [ 'DEBUG_MODE' ]

🛠 CLI

CommandDescription
envdoc diagnoseScan your project and report missing/unused env keys
more commands coming soon

Contributing

  • Fork the repo
  • Create a branch (git checkout -b feature/my-feature)
  • Commit your changes (git commit -m "Add feature")
  • Push (git push origin feature/my-feature)
  • Open a Pull Request

License

MIT License © 2025 Adarsh Antony

Keywords

dotenv

FAQs

Package last updated on 01 Sep 2025

Did you know?

Socket

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.

Install

Related posts