hughsk / envify

:wrench: Selectively replace Node-style environment variables with plain strings.
901 stars 57 forks source link

Add support for dotenv #59

Open LinusU opened 7 years ago

LinusU commented 7 years ago

This PR adds support for loading a .env (dotenv) file containing additional environmental variables. It's super useful when you have multiple projects since it allows you to keep your environment contained to each project instead of having it global.

The file will only be loaded when the dotenv flag is passed, and variables from the file will only be used if they aren't already specified elsewhere which is how the dotenv package usually works when loading it straight into process.env.

I tried to follow the existing code style, please let me know if you need anything more. Thanks πŸ‘‹

LinusU commented 7 years ago

ping @hughsk, would love to see this in since I'm currently using this to build my production app πŸ™ˆ πŸ˜„

LinusU commented 6 years ago

ping @hughsk / @yoshuawuyts, happy to receive feedback ☺️

alanaasmaa commented 6 years ago

Started using @LinusU branch also. I will notify from my side when i get some problems. Looking forward for a merge also :)

LinusU commented 6 years ago

ping @hughsk / @yoshuawuyts, happy to receive feedback ☺️

alanaasmaa commented 6 years ago

Used it 4 months and no issues.

LinusU commented 5 years ago

ping @hughsk / @yoshuawuyts, happy to receive feedback ☺️

yoshuawuyts commented 5 years ago

@LinusU This module is considered feature-complete, which means adding more features isn't within the scope of the project. We should probably write a note about that somewhere though.

Pretty much the only patches that would be accepted at this point are to fix bugs with versions of browserify, or other incompatibility issues. It would probably be best to release a separate module for dotenv support. Thanks!