https://github.com/masoodrb/dotenv
A simple .env file loader for chicken scheme
https://github.com/masoodrb/dotenv
chicken dotenv env scheme
Last synced: 5 months ago
JSON representation
A simple .env file loader for chicken scheme
- Host: GitHub
- URL: https://github.com/masoodrb/dotenv
- Owner: masoodrb
- License: mit
- Created: 2025-12-27T21:42:38.000Z (6 months ago)
- Default Branch: main
- Last Pushed: 2025-12-28T17:55:59.000Z (6 months ago)
- Last Synced: 2025-12-31T01:24:05.569Z (6 months ago)
- Topics: chicken, dotenv, env, scheme
- Language: Scheme
- Homepage: https://github.com/masoodrb/dotenv
- Size: 5.86 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# CHICKEN Scheme dotenv
A lightweight, dependency-conscious utility to load environment variables from `.env` files into your CHICKEN Scheme process.
[](https://api.call-cc.org/5/doc/dotenv)
[](LICENSE)
## Installation
Once indexed in the CHICKEN coop, you can install this egg via:
```bash
chicken-install dotenv
```
## Usage
Create a `.env` file in your project root:
```text
DATABASE_URL=postgres://user:pass@localhost:5432/db
API_SECRET=your_hidden_key_here
# This is a comment and will be ignored
DEBUG=true
```
Load it in your Scheme application:
```scheme
(import dotenv)
;; Loads ".env by default
(load-dotenv)
;; Or specify a custom path
:; (load-dotenv "config/.env.production")
(display (get-environment-variable "DATABASE_URL"))
```
## Features
* **Precise Trimming:** Only removes leading/trailing whitespace, preserving spaces inside values.
* **Comment Support:** Safely ignores lines starting with `#.
* **Value Integrity:** Handles values that contain `=` signs correctly by splitting only at the first occurrence.
* **Minimalist:** Built on top of SRFI-13 for reliable string manipulation.
## Development & Testing
To run the test suite locally:
```bash
chicken-install -test
```
## Contributing
1. Fork the repository.
2. Create your feature branch (`git checkout -b feature/foo`).
3. Commit your changes.
4. Push to the branch.
5. Create a new Pull Request.
## About
- **/Author:** [Masood Ahmed](https://github.com/masoodrb)
- **License:** MIT