https://github.com/ispyhumanfly/raku-dotenv
A Raku dotenv module that loads .env files into your environment
https://github.com/ispyhumanfly/raku-dotenv
Last synced: about 1 month ago
JSON representation
A Raku dotenv module that loads .env files into your environment
- Host: GitHub
- URL: https://github.com/ispyhumanfly/raku-dotenv
- Owner: ispyhumanfly
- License: artistic-2.0
- Created: 2023-01-14T04:34:46.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2023-02-14T16:08:12.000Z (over 2 years ago)
- Last Synced: 2024-10-18T20:48:21.075Z (7 months ago)
- Language: Raku
- Size: 44.9 KB
- Stars: 2
- Watchers: 3
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Dotenv
[](https://opensource.org/licenses/Artistic-2.0)

[](https://ci.sparrowhub.io)A shim to load environment variables from .env into ENV in development. Based on the original [bkeepers](https://github.com/bkeepers/dotenv) 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.
```shell
MY_SECRET_INFO="some value"
MY_API_KEY=123123oiashdam,hwejk1h23kbaamn
```Then inside of your script...
```raku
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`.
```shell
$ dotenv
```## Installation
### Stable
```shell
zef install Env::Dotenv
```
### Unstable
```shell
zef install -v https://github.com/ispyhumanfly/raku-dotenv.git
```