#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

#5 in #blank

Download history 170/week @ 2023-12-06 75/week @ 2023-12-13 2/week @ 2024-01-03 5/week @ 2024-01-10 1/week @ 2024-02-07 11/week @ 2024-02-14 28/week @ 2024-02-21 40/week @ 2024-02-28 28/week @ 2024-03-06 125/week @ 2024-03-13 371/week @ 2024-03-20

566 downloads per month
Used in twitch_message

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