goliatone / envset Goto Github PK
View Code? Open in Web Editor NEWSet env vars before running your program, manage environment and secrets.
License: MIT License
Set env vars before running your program, manage environment and secrets.
License: MIT License
Explore supporting dotenv configuration files.
require('envset')('production');
It would be useful to be able to expand variables:
[development]
PATH = $PATH:/node_modules/.bin
OR
[development]
PATH = ${PATH}:/node_modules/.bin
See npm-run-path as a way to implement this.
To make envset
files less verbose and less error prone, check each environment properties and make sure they have different values, if more than one environments have the same properties and values suggest to either move them to global or else is an error.
[development]
NODE_USERNAME=goliatone
NODE_PASSWORD=secret1
[production]
NODE_USERNAME=goliatone
NODE_PASSWORD=secret2
It wold suggest:
NODE_USERNAME=goliatone
[development]
NODE_PASSWORD=secret1
[production]
NODE_PASSWORD=secret2
Update docs:
envset <environment> -- <command>
:
envset spawns a new process, attaches variables defined for to the process, and executes
We should handle errors on install.
Currently we run postinstall every time we install the package. If we are updating, we might now want to overwrite the config.
Handle error and give message explaining that the command was not found.
envset failed to execute provided command.
Ensure the following is a valid command.
slv docker-compose.tpl
{ Error: spawn slv ENOENT
at exports._errnoException (util.js:1008:11)
at Process.ChildProcess._handle.onexit (internal/child_process.js:182:32)
at onErrorNT (internal/child_process.js:348:16)
at _combinedTickCallback (internal/process/next_tick.js:74:11)
at process._tickCallback (internal/process/next_tick.js:98:9)
at Module.runMain (module.js:577:11)
at run (bootstrap_node.js:352:7)
at startup (bootstrap_node.js:144:9)
at bootstrap_node.js:467:3
code: 'ENOENT',
errno: 'ENOENT',
syscall: 'spawn slv',
path: 'slv',
spawnargs: [ 'docker-compose.tpl' ] }
If we run envset metdata generate
in a repo that has no remote configured it fails:
2022/03/15 20:34:07 the key
remote.origin.url
is not found
We should really think if we want to delete this... what if we are just doing an upgrade?
If envset
tries to execute a file without the right file perms it will throw this error:
{ [Error: spawn EACCES] code: 'EACCES', errno: 'EACCES', syscall: 'spawn' }
suggest to user
If we try to run envset
from a sub-directory in a project it will fail, do walk up the dir hierarchy to find conf.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.