https://github.com/cwhitey/dotty
Retrieve environment variables from .env
https://github.com/cwhitey/dotty
clojure dotenv
Last synced: 4 months ago
JSON representation
Retrieve environment variables from .env
- Host: GitHub
- URL: https://github.com/cwhitey/dotty
- Owner: cwhitey
- License: epl-1.0
- Created: 2018-06-12T14:56:17.000Z (about 8 years ago)
- Default Branch: master
- Last Pushed: 2018-10-09T05:19:33.000Z (over 7 years ago)
- Last Synced: 2025-10-02T08:28:28.628Z (9 months ago)
- Topics: clojure, dotenv
- Language: Clojure
- Homepage:
- Size: 18.6 KB
- Stars: 8
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
[](https://clojars.org/cwhitey/dotty)
# dotty
Retrieves environment variables, prioritizing those defined in `{project_root}/.env`.
- Ignores single-line comments (using `#`)
- Handles empty lines gracefully
- Preserves double-quotes and newline characters in env values
Aims to have rules-parity with [dotenv](https://github.com/motdotla/dotenv#rules) written for node.js.
## Usage
```clojure
(require '[dotty.core :refer [env]])
(env "PATH")
;=> "/bin:/usr/bin:/usr/local/bin"
```
Given your project's `.env` file contains:
```
MY_SECRET_KEY=foo1234
```
Retrieve it with the following:
```clojure
(env "MY_SECRET_KEY")
;=> "foo1234"
```
## License
Copyright © 2018 Callum White
Distributed under the Eclipse Public License either version 1.0 or (at
your option) any later version.