#env-file #loader #sequence #parse #comments #line #blank

simple_env_load

a simple .env loader without any deps

2 unstable releases

0.2.0 Nov 14, 2021
0.1.0 Mar 20, 2020

#6 in #blank

Download history 125/week @ 2024-03-13 492/week @ 2024-03-20 445/week @ 2024-03-27 928/week @ 2024-04-03 511/week @ 2024-04-10 580/week @ 2024-04-17 474/week @ 2024-04-24 424/week @ 2024-05-01 407/week @ 2024-05-08 401/week @ 2024-05-15 401/week @ 2024-05-22 293/week @ 2024-05-29 42/week @ 2024-06-05 19/week @ 2024-06-12 21/week @ 2024-06-19 14/week @ 2024-06-26

99 downloads per month
Used in 2 crates

0BSD license

7KB
93 lines

simple_env_load

Documentation Crates Actions

A simple .env file loader

Description

Giving a sequence of env files from most general to most specific.

Operation

Parse each file for key val remove any comments blank lines and extra whitespace.

Syntax

TEST_DATA=bar       # spaces are optional
## this is a comment
TEST_baz = "baz"    # double quotes are removed
## above line was left intentionally blank

will produce:

Key Value
TEST_DATA bar
TEST_baz baz

License: 0BSD


lib.rs:

A simple .env file loader

Description

Giving a sequence of env files from most general to most specific.

Operation

Parse each file for key val remove any comments blank lines and extra whitespace.

Syntax

TEST_DATA=bar       # spaces are optional
## this is a comment
TEST_BAZ = "baz"    # double quotes are removed
TEST_BAR = 'bar'    # single quotes are removed
## above line was left intentionally blank

will produce:

Key Value
TEST_DATA bar
TEST_BAZ baz
TEST_BAR bar

No runtime deps