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

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

#59 in #env-file

Download history 15/week @ 2024-11-16 17/week @ 2024-11-23 22/week @ 2024-11-30 54/week @ 2024-12-07 44/week @ 2024-12-14 7/week @ 2024-12-21 5/week @ 2024-12-28 23/week @ 2025-01-04 60/week @ 2025-01-11 42/week @ 2025-01-18 15/week @ 2025-01-25 41/week @ 2025-02-01 73/week @ 2025-02-08 52/week @ 2025-02-15 49/week @ 2025-02-22 32/week @ 2025-03-01

218 downloads per month
Used in 8 crates (3 directly)

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