dotenv
Load environment variables from .env files into process.env.
Dev workflow and config npm BSD-2-Clause
Used in agent projects
2,001
15.8% of 12,697 public repos built with AI coding agents
Rank in dev workflow and config
#1 of 88
by use in those projects
Downloads
189M
npm, last 7 days, dotenv
GitHub stars
20.5K
last push Oct 9, 2026
How dotenv is used
dotenv is a dependency in 2,001 of the 12,697 public GitHub projects set up for AI coding agents that we scanned (15.8%), #1 of 88 in dev workflow and config. The most used alternative there is python-dotenv. Projects that use it most often also use TypeScript (73.4%), Express (24.4%), tsx (28.7%). It is more common in projects set up for Devin Desktop (25.5%) than for GitHub Copilot (15.2%).
Often used with dotenv
| TypeScript | 73.4% of dotenv projects |
|---|---|
| Express | 24.4% of dotenv projects · 3.8× more than average |
| tsx | 28.7% of dotenv projects · 2.9× more than average |
| ts-node | 21.9% of dotenv projects · 3.2× more than average |
| Zod | 33.3% of dotenv projects · 2.0× more than average |
| cors | 14.4% of dotenv projects · 4.3× more than average |
| Axios | 23.7% of dotenv projects · 2.4× more than average |
| Solana Web3.js | 29.0% of dotenv projects · 1.8× more than average |
By coding agent
| Claude Code | 15.5% of projects set up for it |
|---|---|
| GitHub Copilot | 15.2% of projects set up for it |
| Cursor | 18.1% of projects set up for it |
| OpenAI Codex | 18.0% of projects set up for it |
| Gemini CLI | 16.7% of projects set up for it |
| Devin Desktop | 25.5% of projects set up for it |
| OpenCode | 18.8% of projects set up for it |
| Kiro | 18.5% of projects set up for it |
Share of public repos configured for each agent that list dotenv as a dependency.
Install
| Package | npm install dotenv |
|---|---|
| Main stacks | TypeScript / JavaScript (1,396), Next.js (487), Rust (59), Python (38) |
| Example projects | Automattic/wp-calypso, apify/apify-mcp-server, ding113/claude-code-hub, JMBeresford/retrom, sunflower-land/sunflower-land |
Alternatives to dotenv
| Tool | Used in agent projects | Downloads / wk | GitHub stars | License |
|---|---|---|---|---|
| python-dotenv pypi Load environment variables from .env files in Python applications. |
828 (6.5%) | 156M | 8,898 | BSD-3-Clause |
| Husky npm Modern Git hooks manager for running tasks on git events. |
797 (6.3%) | 36.2M | 35.3K | MIT |
| lint-staged npm Run linters on git staged files to catch issues before commit. |
591 (4.7%) | 29.5M | 14.7K | MIT |
| concurrently npm Run multiple npm scripts concurrently for efficient development workflows. |
572 (4.5%) | 22.2M | 7,856 | MIT |
| cross-env npm Set environment variables across Windows, Mac and Linux in npm scripts. |
265 (2.1%) | 25.8M | 6,521 | MIT |
| Pydantic Settings pypi Settings management and configuration from environment variables using Pydantic. |
251 (2.0%) | 96.8M | 1,475 | — |
| Rich pypi Python library for rich text and beautiful formatting in terminal output. |
243 (1.9%) | 117M | 57.5K | MIT |
| rimraf npm Cross-platform delete directories and files recursively like Unix rm -rf command. |
230 (1.8%) | 16M | 5,855 | BlueOak-1.0.0 |