npm install webapp-env
- Prepare input env file(.env).
A=foo
B=bar
- Run command
webapp-env .env vars.js
It generates the following js file.
window.envVars = {"A":"foo","B":"bar"};
You can import this file on your html file.
<script src="./vars.js"></script>
<script>
window.addEventListener("load", function () {
console.log(envVars);
});
</script>
- Fork it ( http://github.com/argano/webapp-env )
- Create your feature branch (git checkout -b my-new-feature)
- Commit your changes (git commit -am 'Add some feature')
- Push to the branch (git push origin my-new-feature)
- Create new Pull Request
MIT