#env #apply #env-var #applier

bin+lib env_applier

Apply environment variables on an object

9 releases (3 stable)

new 1.1.1 Dec 15, 2024
1.1.0 Dec 14, 2024
0.1.2 May 3, 2020
0.1.1 Mar 22, 2020

#175 in Configuration

Download history 22/week @ 2024-09-23 13/week @ 2024-11-04 416/week @ 2024-12-09

416 downloads per month
Used in chewdata

GPL-3.0 license

20KB
79 lines

env_applier

Actions Status semantic-release crates.io

Apply environment variables on a string.

Getting Started

Quick Start

extern crate env_applier;

use env_applier::*;

fn main() -> () {
    let config = r#"{"test":"{{ HOME }}"}"#.to_string().apply();
    println!("My new config : {:?}", config);
}

or with prefix

extern crate env_applier;

use env_applier::*;

fn main() -> () {
    let config = r#"{"test":"{{ HOME }}"}"#.to_string().apply_with_prefix("MY_PREFIX");
    println!("My new config : {:?}", config);
}

Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

Please make sure to update tests as appropriate.

License

Apache MIT

No runtime deps