mwoods79
Envious - a simple env parser written with NimbleParsec
Last year at Jax.Ex (Jacksonville Elixir Meetup) we live mob coded the start of a dotenv parser to learn NimbleParsec. It’s been on my list of things to complete for a while. Today Claude Code helped me finish the outstanding issues.
Features
- Comments: Lines starting with
#are ignored- Export prefix: Optional
exportkeyword (shell compatibility)- Quoted values: Single and double quotes with escape sequences
- Multi-line values: Quoted values can span multiple lines
- Empty values:
KEY=produces an empty string- Digits in keys: Variable names like
DB2_HOST,API_V2_URLare supported- Escape sequences:
\n,\t,\r,\\,\",\'in quoted strings- Blank lines: Multiple blank lines and trailing whitespace are handled correctly
You can use it like this:
# config/runtime.exs
import Config
# Load environment-specific .env file if it exists
env_file = ".#{config_env()}.env"
if File.exists?(env_file) do
env_file |> File.read!() |> Envious.parse!() |> System.put_env()
end
# Do your normal 12-factor things
config :my_app,
key1: System.get_env("KEY1"),
key2: System.get_env("KEY2")
Hope you find it useful. ![]()
Most Liked
Popular in Announcing
ex_cldr provides localisation and internationalisation support based upon the data from the Unicode CLDR project.
Unicode released CLDR ...
New
Once is an Ecto type for locally unique 64-bits IDs generated by multiple Elixir nodes. Locally unique IDs make it easier to keep things ...
New
:smiling_face_with_sunglasses: New package usage_rules released! Just place a usage-rules.md file in your package and users can sync it t...
New
Hi Everyone,
I’d like to share my first open-source package and my first Elixir project, GeoMeasure. It enables one to calculate propert...
New
An ExUnit formatter to visualize test execution and find bottlenecks in your test suite.
I created a small library called ex_unit_spa...
New
An application wishing to store larger amounts of data typically has two options for doing so:
A new column on some table can be introd...
New
Hello Elixir community,
I’ve written a small embedded key-value database in Elixir called Goblin. It’s based on the Log-Structured Merge...
New
I’ve been working with Claude Code extensively and absolutely love it. However, I’ve come across the challenge of managing configuration ...
New
I took lessons from the last discussion and cobbled together an example as a proof-of-concept.
Mar demonstrates a Flask-like web dev int...
New
Hey folks!
Want to present a toolkit for writing command-line user interfaces.
It provides a convenient interface for
colorizing text...
New
Other popular topics
I have seen a lot of code which picks the first element from a list using Enum.at(0) instead of List.first. Is there a reason why people ...
New
i’m a new one to elixir
which editor can i use
vs code? or atom?
Thanks! :smiley:
New
How to handle excepions in elixir? Suppose i have A, B, C ,D, E modules. and each module has get() function. A.get() method will call th...
New
In asking this question I am more interested about the expressiveness of the language itself and less concerned about the availability of...
New
As many of you may have realized by now (sorry for all the posts here) I’ve been working on a db problem where I’m trying to aggregate a ...
New
Hi. I’ve noticed that Windows Powershell has it’s own IEX command and you cannot access Elixir’s IEX due to the conflict. This isn’t a cr...
New
Hello, can anybody help here..? I have a list of players and I what to delete an element, but every for loop the list is reverting to ori...
New
I have a another noob question about loop. Since elixir is immutable, while loop is not directly possible.
total = 10
while total != 0
...
New
Is there a way to get the call stack or stack trace at any point in the code? Not from exceptions, but an expression that returns how the...
New
Original source of discussion: This topic on the Pragmatic Programmers' Functional Web Development with Elixir, OTP, and Phoenix forum.
...
New







