#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 80/week @ 2024-07-21 51/week @ 2024-07-28 8/week @ 2024-08-04 27/week @ 2024-08-11 6/week @ 2024-08-18 35/week @ 2024-08-25 24/week @ 2024-09-01 41/week @ 2024-09-22 71/week @ 2024-09-29 96/week @ 2024-10-06 28/week @ 2024-10-13 18/week @ 2024-10-20 38/week @ 2024-10-27 13/week @ 2024-11-03

110 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