Skip to content

A Raku dotenv module that loads .env files into your environment

License

Notifications You must be signed in to change notification settings

ispyhumanfly/raku-dotenv

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

53 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Dotenv

License: Artistic-2.0 Zef Badge SparrowCI

A shim to load environment variables from .env into ENV in development. Based on the original bkeepers module written in Ruby. And from this one https://pypi.org/project/python-dotenv/

Synopsis

In your application or scripts root directory, create a .env file and place some variables in it.

MY_SECRET_INFO="some value"
MY_API_KEY=123123oiashdam,hwejk1h23kbaamn

Then inside of your script...

use v6;
use Env::Dotenv :ALL;

dotenv_load();

for %*ENV.kv -> $key, $value {
    "$key: $value".say;
}

my %dotenv = dotenv_values();

say %dotenv{"MY_SECRET_INFO"};

for dotenv_values().kv -> $key, $value {
    "$key: $value".say;
}

A command line interface is also in the works. Right now it only outputs the variables it finds inside of your .env.

$ dotenv

Installation

Stable

zef install Env::Dotenv

Unstable

zef install -v https://github.com/ispyhumanfly/raku-dotenv.git

About

A Raku dotenv module that loads .env files into your environment

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published