webapp-env
v0.0.2
Published
``` npm install webapp-env ```
Downloads
3
Readme
webapp-env
npm install webapp-env
Usage
- 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>
Contribution
- 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
License
MIT