dotconf 0.1.3

A very light-weight dotenv crate
Documentation
  • Coverage
  • 53.85%
    7 out of 13 items documented5 out of 13 items with examples
  • Size
  • Source code size: 9.69 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 1.81 MB This is the summed size of all files generated by rustdoc for all configured targets
  • Ø build duration
  • this release: 13s Average build duration of successful builds.
  • all releases: 14s Average build duration of successful builds in releases after 2024-10-23.
  • Links
  • Homepage
  • devfans/dotconf-rs
    1 0 0
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • devfans

dotconf: A super light-weight dotenv library

With less than 20 lines of code of the core part, but meet most of the requirements of a dotenv. JUST KEEP IT SIMPLE!

Examples

Sample .env file:

a = hi  # This is a comment
b = -123
c = false
use dotconf::{init, init_with_path};

init().ok() // Ignore the error even if `.env` does not exist.
init().expect("Failed to load env conf file (default: .env)");
init_with_path(".dotenvfile").expect("Failed to load from the specified env conf file");

// Read value with env::var with some simple type conversions
let a = dotconf::var("a").to_string().unwrap(); 
let b = dotconf::var("b").to_isize().unwrap();
let c = dotconf::var("c").to_bool().unwrap();