Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/alpheustangs/dotenv_plus.rs
A dotenv extension for Rust
https://github.com/alpheustangs/dotenv_plus.rs
dotenv env environment file rust var variables
Last synced: about 1 month ago
JSON representation
A dotenv extension for Rust
- Host: GitHub
- URL: https://github.com/alpheustangs/dotenv_plus.rs
- Owner: alpheustangs
- License: mit
- Created: 2024-09-27T06:18:56.000Z (4 months ago)
- Default Branch: main
- Last Pushed: 2024-10-20T15:13:03.000Z (3 months ago)
- Last Synced: 2024-10-20T16:56:47.115Z (3 months ago)
- Topics: dotenv, env, environment, file, rust, var, variables
- Language: Rust
- Homepage: https://docs.rs/dotenv_plus
- Size: 20.5 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Dotenv+
A dotenv extension for Rust.
## Installation
To install this package, run the following command:
```bash
cargo add dotenv_plus
```## Quick Start
Initialize the environment variables and get different variables with the following code:
```rust
use dotenv_plus::{
env::{DotEnv, set_env, get_env},
vars::get_rust_env,
};DotEnv::new().done();
assert_eq!(get_rust_env(), "development");
set_env("key", "value");
assert_eq!(get_env("key"), "value");
```## License
This project is licensed under the terms of the MIT license.