#env-var #env-file #environment #variables #load

bin+lib denv

Load environment variables from .env file

2 unstable releases

0.3.0 Sep 10, 2021
0.2.0 Jan 3, 2017

#46 in #env-file

MIT license

8KB
164 lines

denv-rust

Build Status crates.io

Load environment variables from .env file.

CLI usage

Usage: denv [OPTIONS] COMMAND...

Options:
    -f, --filename FILENAME
                        Path to .env file
    -h, --help          Print help
% cat .env
FOO=bar
% denv printenv FOO
bar
% cat hoge.env
HOGE=fuga
% denv -f printenv HOGE
fuga

Library usage

denv::load("/path/to/.env").expect("Unable to load .env file");

Acknowledgment

Original implementation is written by taiki45. https://github.com/taiki45/denv

Dependencies

~1.4–2.3MB
~39K SLoC