Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

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

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.