All Projects → goliatone → envset

goliatone / envset

Licence: MIT license
Set env vars before running your program, manage environment and secrets.

Programming Languages

javascript
184084 projects - #8 most used programming language
python
139335 projects - #7 most used programming language
Smarty
1635 projects
shell
77523 projects

Projects that are alternatives of or similar to envset

dotenvy
Speed up your production sites by ditching .env for key/value variable pairs as Apache, Nginx, and shell equivalents
Stars: ✭ 31 (-8.82%)
Mutual labels:  environment-variables, env
tfenv
Transform environment variables for use with Terraform (e.g. `HOSTNAME` ⇨ `TF_VAR_hostname`)
Stars: ✭ 120 (+252.94%)
Mutual labels:  environment-variables, env
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 (+111.76%)
Mutual labels:  environment-variables, env
envfile
Parse and write environment files with Node.js
Stars: ✭ 42 (+23.53%)
Mutual labels:  environment-variables, env
envyable
The simplest yaml to ENV config loader.
Stars: ✭ 78 (+129.41%)
Mutual labels:  environment-variables, env
Node Convict
Featureful configuration management library for Node.js
Stars: ✭ 1,855 (+5355.88%)
Mutual labels:  environment-variables, env
env-dot-prop
♻️ Get, set, or delete nested properties of process.env using a dot path
Stars: ✭ 31 (-8.82%)
Mutual labels:  environment-variables, env
ts-dotenv
Strongly-typed environment variables for Node.js
Stars: ✭ 18 (-47.06%)
Mutual labels:  environment-variables, env
read-env
🔧 Transform environment variables into JSON object with sanitized values.
Stars: ✭ 60 (+76.47%)
Mutual labels:  environment-variables, env
webpack-dotenv-plugin
Use dotenv with webpack.
Stars: ✭ 53 (+55.88%)
Mutual labels:  environment-variables, env
gatsby-plugin-dynamic-routes
Creating dynamic routes based on your environment and/or renaming existing routes
Stars: ✭ 14 (-58.82%)
Mutual labels:  environment-variables, env
envman
Manage your .env configuration easily
Stars: ✭ 20 (-41.18%)
Mutual labels:  environment-variables, env
env
A lightweight package for loading OS environment variables into structs for Go projects
Stars: ✭ 24 (-29.41%)
Mutual labels:  environment-variables, env
exenv
Exenv makes loading environment variables from external sources easy.
Stars: ✭ 35 (+2.94%)
Mutual labels:  environment-variables, env
sicher
Sicher is a go module that allows secure storage of encrypted credentials in a version control system.
Stars: ✭ 27 (-20.59%)
Mutual labels:  environment-variables, env
envsafe
🔒 Makes sure you don't accidentally deploy apps with missing or invalid environment variables.
Stars: ✭ 705 (+1973.53%)
Mutual labels:  environment-variables, env
fuck-env
Fuck environment variables everywhere
Stars: ✭ 14 (-58.82%)
Mutual labels:  environment-variables, env
goodconf
Transparently load variables from environment or JSON/YAML file.
Stars: ✭ 80 (+135.29%)
Mutual labels:  environment-variables, env
envclasses
envclasses is a library to map fields on dataclass object to environment variables.
Stars: ✭ 26 (-23.53%)
Mutual labels:  environment-variables, env
checkdotenv
Verify environment variables presence for Node JS.
Stars: ✭ 12 (-64.71%)
Mutual labels:  environment-variables, env

envset

envset runs another program with a custom environment according to values defined in a .envset config file, which follows the ini file format. You can share this file between team members.

Inspired by daemontools' tool envdir.


Environment level configuration

Application configuration usually is environment specific and changes between build distributions.

If you follow the 12 factor app guidelines, then you know you should store your configuration in the environment.

By application configuration we mean small and oftentimes sensitive data such as API keys, database credentials. Not all environment configuration is sensitive and are instead build distribution specific values such as the application's TCP port, base URL to build OAuth callbacks, or logging verbosity.

envset helps you manage and set environment variables for multiple build distributions and share environment variables between team members.

Is as simple as calling:

envset development -- node server.js

Examples

An .envset file could look like this:

[production]
NODE_AWS_SECRET_ACCESS_KEY=FS40N0QY22p2bpciAh7wuAeHjJURgXIBQ2cGodpJD3FRjw2EyYGjyXpi73Ld8zWO
NODE_AWS_ACCESS_KEY_ID=LSLhv74Q1vH8auQKUt5pFwnix0FUl0Ml
NODE_HONEYBADGER_KEY=LCgZgqsxKfhO
NODE_POSTGRES_ENDPOINT=50.23.54.25
NODE_POSTGRES_DATABASE=myproject
NODE_POSTGRES_PSWD=Pa$sW03d
NODE_POSTGRES_USER=myproject

[development]
NODE_AWS_SECRET_ACCESS_KEY=HN5ITok3lDaA1ASHxtEpy1U9XCjZwThmfgoIYZk8bkOqc5yk6sT7AWd3ooNeRFV9
NODE_AWS_ACCESS_KEY_ID=m35W4PGGVZfj1gOxYvztFxBD5F2605B3
NODE_HONEYBADGER_KEY=f3MNPUhZoki6
NODE_POSTGRES_ENDPOINT=localhost
NODE_POSTGRES_DATABASE=postgres
NODE_POSTGRES_PSWD=postgres
NODE_POSTGRES_USER=postgres

To use it, simply prefix the call to your program with envset and the name of the environment:

$ envset development -- node app.js

You can:

[local]
MSG=Hello World
envset local -- env | grep MSG | say

Getting Started

Install the module globally with:

npm install envset -g

This will provide a CLI interface, which can be accessed via terminal:

$ envset

If you have recently installed node or npm and get an EACCES error during installation on envset look at this page about fixing permissions on npm.

Documentation

Commands

If you type envset without arguments it will display help and a list of supported environment names.

.envset file

.envsetrc

You can create an .envsetrc file with configuration options for envset.

The default .envsetrc looks like this:

;Default environment names
filename=./.envset
exportEnvironment=NODE_ENV

[environments]
names[]=test
names[]=staging
names[]=production
names[]=development

Configuration

Follows rc standards.

Post and pre installation hooks

The package.json file includes two installation live cycle scripts:

postinstall:

Executed after installation of the module. It creates a default .envsetrc config file in the user's home directory.

postuninstall:

Executed after uninstalling the module. It removes the .envsetrc file created during installation.

Contributing

In lieu of a formal styleguide, take care to maintain the existing coding style. Add unit tests for any new or changed functionality. Lint and test your code using Grunt.

Release History

  • 2015-11-02: v0.2.0: Initial npm release.
  • 2015-11-21: v0.3.0: Added '--' to separate command.
  • 2015-11-23: v0.4.0: Print env if no command provided.
  • 2016-06-14: v0.6.0: Fix update-notifier.
  • 2016-06-14: v0.7.0: Fix postinstall.
  • 2016-06-17: v0.8.0: Remove cruft.
  • 2016-06-23: v0.9.0: Walk directory tree upwards looking for .envset.

TODO

  • Tests
  • Programmatic interface
  • Output to stdout so that we can pipe commands

License

Copyright (c) 2015 goliatone
Licensed under the MIT license.

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].