mirror of
https://github.com/oven-sh/bun
synced 2026-02-15 05:12:29 +00:00
Add process.loadEnvFile() method that loads environment variables from .env files and returns them as a JavaScript object. Features: - Loads and parses .env files with support for: - Basic key=value pairs - Quoted strings (single and double quotes) - Multiline values - Variable expansion - Export statements - Comments and empty lines - Returns parsed variables as a JavaScript object - Proper error handling for invalid files or arguments - Memory-safe implementation using VM allocator Implementation: - Added jsFunctionProcessLoadEnvFile to BunProcess.cpp function table - Implemented parsing logic in src/env_loader.zig using existing env parser - Added comprehensive test suite covering all supported features - All tests pass (7/7) 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>