Performance: dotenv for environment configuration
LOW IMPACT
dotenv affects the initial loading time of a Node.js application by reading environment variables from a file before the app starts.
// Call dotenv.config() once at the app entry point
require('dotenv').config();
// Other modules access process.env directlyrequire('dotenv').config(); // Called multiple times in different modules
| Pattern | File Reads | Startup Delay | Runtime Impact | Verdict |
|---|---|---|---|---|
| Multiple dotenv.config() calls | Multiple reads | Increases by 10-20ms per call | None | [X] Bad |
| Single dotenv.config() call at entry | One read | Minimal (~10ms) | None | [OK] Good |