Skip to content

Voctl/nimdot-env

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

nimdot_env

.env file loader for nim. reads a file, loads variables. that's all.


install

not on nimble yet. clone it manually:

git clone https://github.com/Voctl/nimdot-env
cd nimdot-env

then copy src/nimdot_env into your project or add the path to your .nimble file:

# yourproject.nimble
requires "nim >= 1.0.0"
# add nimdot_env source path manually

usage

import nimdot_env

loadEnv()  # loads .env from current directory

echo getEnv("MY_VAR")

your .env file:

DB_HOST=localhost
DB_PORT=5432
SECRET_KEY=whatever

structure

nimdot_env/
├── src/nimdot_env/
├── tests/
├── nimdot_env.nimble
└── LICENSE

why

because hardcoding secrets is bad.
because os environment variables shouldn't require a framework.
one function. one file. done.


license

MIT.

About

minimal .env file loader for nim. one function, zero bloat.

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages