Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/Grubba27/gleam_dotenv
dotenv for gleam
https://github.com/Grubba27/gleam_dotenv
Last synced: 3 months ago
JSON representation
dotenv for gleam
- Host: GitHub
- URL: https://github.com/Grubba27/gleam_dotenv
- Owner: Grubba27
- License: mit
- Created: 2023-10-25T01:00:03.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2024-06-13T13:17:49.000Z (6 months ago)
- Last Synced: 2024-08-29T01:09:50.246Z (4 months ago)
- Language: Gleam
- Size: 17.6 KB
- Stars: 7
- Watchers: 1
- Forks: 2
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-gleam - gleam_dotenv - [📚](https://hexdocs.pm/gleam_dotenv/) - dotenv for Gleam (Packages / Configuration)
README
# dotenv_gleam
[![Package Version](https://img.shields.io/hexpm/v/dotenv)](https://hex.pm/packages/dotenv_gleam)
[![Hex Docs](https://img.shields.io/badge/hex-docs-ffaff3)](https://hexdocs.pm/dotenv_gleam/)Similar to [Node](https://www.npmjs.com/package/dotenv) dotenv and [Ruby](https://github.com/bkeepers/dotenv) dotenv
## Installation
If available on Hex this package can be added to your Gleam project:
```sh
gleam add dotenv_gleam
```then in your code:
```gleam
import dotenv_gleam
import gleam/erlang/os // do not forget to add gleam_erlang to the projectpub fn main() {
dotenv_gleam.config() // this should load .env filelet assert Ok(test) = os.get_env("TEST")
let assert Ok(bar) = os.get_env("BAR")}
// or you can specify the path to the .env file
pub fn main() {
dotenv_gleam.config_with("path/to/.env") // this should load .env filelet assert Ok(test) = os.get_env("TEST")
let assert Ok(bar) = os.get_env("BAR")
}```
and its documentation can be found at .