sholladay / envy Goto Github PK
View Code? Open in Web Editor NEWLoad .env files and environment variables
License: Mozilla Public License 2.0
Load .env files and environment variables
License: Mozilla Public License 2.0
envy
requires you to put 600
as file permission on .env
. Alas if your workspace is in the Windows land you cannot change the file permission from your bash environment. The problem is that Windows' permissions system is not as granular as Linux' is. You cannot set a 600
on it (at least I haven't found a way) however you can set 666
, 000
or 777
.
One way to solve this is changing the permissions requirements based on the platform running envy
, we could settle for 666
when process.platform === 'win32'
.
The recipe for loading the environment variables into process.env
is pretty simple, but it's nonetheless more cumbersome than it ought to be. We should include this feature as an optional part of our API.
My thought is something like:
envy.assign('.env', process.env);
Or, given that #5 will be implemented, perhaps:
envy.assign({ target : process.env });
Not sure about the names assign
and target
here. Suggestions for other names welcome.
As a developer working on this library, I want CI to test my code on both *nix and Windows operating systems, so platform specific bugs and regressions are caught.
Setup AppVeyor CI to run the tests in an actual Windows environment.
The setup-tests.sh
script will need to be made cross-platform. One possible approach would be to re-write it in Node and use glob and fs.chmod().
I need to support multiple environments for my server. Also different environments have different variables. But there is not a clean/simple way to do it.
Right now to support 2 envs you will have to create .env.prod
and .env.prod.example
pairs for each env.
Ideally I would like to have max to files but maybe when you call:
const env = envy({yourEnv});
and inside .env.example
and .env
you can have few functions???
Even after performing chmod 555 .env envy throws file permission error on Windows 10 platform. This was attempted as administrator using both Cygwin and Gitbash CLIs.
In the Node v 10 REPL, fs.statSynch returns value of o444. Please refer to node documentation:
https://github.com/nodejs/node/blob/bf12414bbf4295cb47c4c8b69bc2aa6828778453/lib/fs.js#L1073
which mentions the following:
Caveats: on Windows only the write permission can be changed, and the distinction among the permissions of group, owner or others is not implemented.
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.