# envmnt
[](https://crates.io/crates/envmnt) [](http://travis-ci.org/sagiegurari/envmnt) [](https://ci.appveyor.com/project/sagiegurari/envmnt) [](https://codecov.io/gh/sagiegurari/envmnt)<br>
[](https://github.com/sagiegurari/envmnt/blob/master/LICENSE) [](https://libraries.io/cargo/envmnt) [](https://docs.rs/crate/envmnt/) [](https://crates.io/crates/envmnt)<br>
[](https://sagiegurari.github.io/cargo-make)
> Environment variables utility functions.
* [Overview](#overview)
* [Usage](#usage)
* [Installation](#installation)
* [API Documentation](https://sagiegurari.github.io/envmnt/)
* [Contributing](.github/CONTRIBUTING.md)
* [Release History](#history)
* [License](#license)
<a name="overview"></a>
## Overview
This library has many helper functions to access/modify/check environment variables.
<a name="usage"></a>
## Usage
Simply include the library and invoke the various utility functions, for example:
```rust
extern crate envmnt;
fn main() {
if !envmnt::exists("MY_ENV_VAR") {
envmnt::set("MY_ENV_VAR", "SOME VALUE");
}
let value = envmnt::get_or("MY_ENV_VAR", "DEFAULT_VALUE");
println!("Env Value: {}", &value);
envmnt::set_bool("FLAG_VAR", true);
let flag_value = envmnt::is_or("FLAG_VAR", false);
println!("Bool Flag: {}", &flag_value);
let pre_value = envmnt::get_set("MY_ENV_VAR", "SOME NEW VALUE");
let value = envmnt::get_or("MY_ENV_VAR", "DEFAULT_VALUE");
println!("New Env Value: {}", &value);
println!("Previous Env Value: {:?}", &pre_value);
}
```
<a name="installation"></a>
## Installation
In order to use this library, just add it as a dependency:
```ini
[dependencies]
envmnt = "*"
```
## API Documentation
See full docs at: [API Docs](https://sagiegurari.github.io/envmnt/)
## Contributing
See [contributing guide](.github/CONTRIBUTING.md)
<a name="history"></a>
## Release History
| 2019-05-08 | v0.1.0 | Initial release. |
<a name="license"></a>
## License
Developed by Sagie Gur-Ari and licensed under the Apache 2 open source license.