Crates.io | env_parser |
lib.rs | env_parser |
version | 0.1.10 |
source | src |
created_at | 2020-10-17 16:57:01.540292 |
updated_at | 2024-01-03 10:51:48.600728 |
description | Env parser. Parse your env file and create a Rust file with mapped properties |
homepage | |
repository | https://github.com/jasperav/env_parser |
max_upload_size | |
id | 301507 |
size | 43,069 |
This crate will parse an .env
file. By implementing the Transformer
trait, you can
customize the behaviour after processing key value pair in the env file. Comments are preserved and
can be used on top of the Rust mapped property.
For convenience there is a feature to_lazy_static
that will automatically map key value pairs into a lazy_static
block.
Check assert_test.rs
and assert_test_lazy.rs
for examples.
Add the following to your Cargo.toml...
[dependencies]
env_parser = "*"
Ideally, create build.rs
file and call the env_parser
reader from the build file, so that your mapped Rust file
is always in sync with your .env
file.