All Projects → drum445 → dotenv

drum445 / dotenv

Licence: MIT license
Load .env files in crystal

Programming Languages

crystal
512 projects
shell
77523 projects

Projects that are alternatives of or similar to dotenv

Dotenv Flow
Loads environment variables from .env.[development|test|production][.local] files for Node.js® projects.
Stars: ✭ 537 (+3256.25%)
Mutual labels:  dotenv, environment-variables
checkdotenv
Verify environment variables presence for Node JS.
Stars: ✭ 12 (-25%)
Mutual labels:  dotenv, environment-variables
Dotenv Webpack
A secure webpack plugin that supports dotenv and other environment variables and only exposes what you choose and use.
Stars: ✭ 1,022 (+6287.5%)
Mutual labels:  dotenv, environment-variables
Phpdotenv
Loads environment variables from `.env` to `getenv()`, `$_ENV` and `$_SERVER` automagically.
Stars: ✭ 11,648 (+72700%)
Mutual labels:  dotenv, environment-variables
dart environment config
Environment specific config generator for Dart and Flutter applications during CI/CD builds
Stars: ✭ 87 (+443.75%)
Mutual labels:  dotenv, environment-variables
Dotenv Kotlin
🗝️ Dotenv is a module that loads environment variables from a .env file
Stars: ✭ 326 (+1937.5%)
Mutual labels:  dotenv, environment-variables
exenv
Exenv makes loading environment variables from external sources easy.
Stars: ✭ 35 (+118.75%)
Mutual labels:  dotenv, environment-variables
ts-dotenv
Strongly-typed environment variables for Node.js
Stars: ✭ 18 (+12.5%)
Mutual labels:  dotenv, environment-variables
superconfig
Access environment variables. Also includes presence validation, type coercion and default values.
Stars: ✭ 33 (+106.25%)
Mutual labels:  dotenv, environment-variables
Env Var
Verification, sanitization, and type coercion for environment variables in Node.js
Stars: ✭ 201 (+1156.25%)
Mutual labels:  dotenv, environment-variables
envfile
Parse and write environment files with Node.js
Stars: ✭ 42 (+162.5%)
Mutual labels:  dotenv, environment-variables
ini
📝 Go INI config management. support multi file load, data override merge. parse ENV variable, parse variable reference. Dotenv file parse and loader. INI配置读取管理,支持多文件加载,数据覆盖合并, 解析ENV变量, 解析变量引用。DotEnv 解析加载
Stars: ✭ 72 (+350%)
Mutual labels:  dotenv, environment-variables
dotenv.net
A library to read .env files in a .NET Core environment
Stars: ✭ 126 (+687.5%)
Mutual labels:  dotenv, environment-variables
Sync Dotenv
Keep your .env in sync with .env.example
Stars: ✭ 393 (+2356.25%)
Mutual labels:  dotenv, environment-variables
gconfigs
gConfigs - Config and Secret parser
Stars: ✭ 42 (+162.5%)
Mutual labels:  dotenv, environment-variables
Dotenv Java
🗝️ Dotenv is a no-dep, pure Java module that loads environment variables from a .env file
Stars: ✭ 72 (+350%)
Mutual labels:  dotenv, environment-variables
ngx-env
Easily inject environment variables into your Angular applications
Stars: ✭ 73 (+356.25%)
Mutual labels:  dotenv, environment-variables
cypress-dotenv
Cypress plugin that enables compatability with dotenv
Stars: ✭ 47 (+193.75%)
Mutual labels:  dotenv, environment-variables
React Native Dotenv
Load react native environment variables using import statements for multiple env files.
Stars: ✭ 190 (+1087.5%)
Mutual labels:  dotenv, environment-variables
dotenvy
Speed up your production sites by ditching .env for key/value variable pairs as Apache, Nginx, and shell equivalents
Stars: ✭ 31 (+93.75%)
Mutual labels:  dotenv, environment-variables

dotenv

Loads .env file in Crystal and optionally loads them directly into your ENV var: https://crystal-lang.org/api/0.27.0/ENV.html
Will always return the .env file as a hash regardless of whether you chose to load into your ENV or not

Installation

  1. Add the dependency to your shard.yml:
dependencies:
  dotenv:
    github: drum445/dotenv
  1. Run shards install

Usage

require "dotenv"

Having a .env file

ENV=dev
PORT=3000
LOGGING=true
CORS=*

DB_DRIVER=mysql
DB_USERNAME=root
DB_PASSWORD=password
DB_HOST=localhost
DB_PORT=3306
DB_DATABASE=test
Using a file called .env and loading into your ENV var
require "dotenv"

Dotenv.load # => {"ENV" => "dev", "PORT" => "3000", "LOGGING" => "true", "CORS" => "*", "DB_DRIVER" => "mysql", "DB_USERNAME" => "root", "DB_PASSWORD" => "password", "DB_HOST" => "localhost", "DB_PORT" => "3306", "DB_DATABASE" => "test"}
Using a file called .env and NOT loading into your ENV var
require "dotenv"

hash = Dotenv.load(set_env: false)
Using a file NOT called .env and loading into your ENV var
require "dotenv"

Dotenv.load(path: ".env.live")

Overriding

By default the existing environment will be overriden by contents of the .env file. To disable this behaviour pass false to override_env parameter:

require "dotenv"

hash = Dotenv.load(override_env: false)

Development

TODO: Write development instructions here

Contributing

  1. Fork it (https://github.com/drum445/dotenv/fork)
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create a new Pull Request

Contributors

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].