all_env 0.1.0

A library to retrieve environment variables from different file types.
Documentation
  • Coverage
  • 83.33%
    5 out of 6 items documented1 out of 6 items with examples
  • Size
  • Source code size: 14.56 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 1.8 MB This is the summed size of all files generated by rustdoc for all configured targets
  • Ø build duration
  • this release: 26s Average build duration of successful builds.
  • all releases: 26s Average build duration of successful builds in releases after 2024-10-23.
  • Links
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • Maestro2496

EnvVar

EnvVar is a Rust library for retrieving environment variables from different file types.

Supported File Types

  • Simple txt files (.txt, .env)
  • JSON files (.json)

Installation

Add the following to your Cargo.toml file:

[dependencies]
all_env = "0.1.0"

Examples

Examples with debug

use all_env::EnvHolder;
 // With debug flag set to true
let env_holder = EnvHolder::new(true);
let url = env_holder.get_var("url");
if let Some(url_value) = url {
    // Further processing
 }

Examples without debug with and a custom file_name

use all_env::EnvHolder;
 // With debug flag set to true
let env_holder = EnvHolder::new(false).with_file_name("custom_file.env");
let url = env_holder.get_var("url");
if let Some(url_value) = url {
    // Further processing
 }

Contributing

Contributions are welcome! If you find a bug, have a feature request, or would like to contribute to the project, please feel free to open an issue or submit a pull request. Your feedback and contributions help make this library better for everyone.