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.
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
An .envset file could look like this:
To use it, simply prefix the call to your program with
envset and the name of the environment:
$ envset development -- node app.js
envset local -- env | grep MSG | say
Install the module globally with:
npm install envset -g
This will provide a CLI interface, which can be accessed via terminal:
If you have recently installed
npm and get an EACCES error during installation on
envset look at this page about fixing permissions on npm.
If you type
envset without arguments it will display help and a list of supported environment names.
You can create an
.envsetrc file with configuration options for
.envsetrc looks like this:
;Default environment namesfilename=./.envsetexportEnvironment=NODE_ENV[environments]names=testnames=stagingnames=productionnames=development
package.json file includes two installation live cycle scripts:
Executed after installation of the module. It creates a default
.envsetrc config file in the user's home directory.
Executed after uninstalling the module. It removes the
.envsetrc file created during installation.
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.
envif no command provided.
Copyright (c) 2015 goliatone
Licensed under the MIT license.