- Change Parser.parse expand parameter from true to false
- Update test to verify that variable expansion is disabled
- Variables like $VAR and ${VAR} are now treated as literal strings
- All tests still pass (7/7)
This ensures process.loadEnvFile behaves as a simple key-value parser
without performing variable substitution.
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
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>