<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Luke Harris</title>
    <description>The latest articles on DEV Community by Luke Harris (@luk707).</description>
    <link>https://dev.to/luk707</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F25164%2Fb657c220-d892-46f2-b40a-6be5c869a8f6.jpg</url>
      <title>DEV Community: Luke Harris</title>
      <link>https://dev.to/luk707</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/luk707"/>
    <language>en</language>
    <item>
      <title>Managing dotenv files in git repositories</title>
      <dc:creator>Luke Harris</dc:creator>
      <pubDate>Fri, 15 Sep 2017 12:55:20 +0000</pubDate>
      <link>https://dev.to/luk707/managing-dotenv-files-in-git-repositories</link>
      <guid>https://dev.to/luk707/managing-dotenv-files-in-git-repositories</guid>
      <description>&lt;p&gt;Sometimes your project needs access to sensitive information like an access token or database password. Maybe your project needs some configuration like a hostname or a port to run on.&lt;/p&gt;

&lt;p&gt;If so then it is likely that you are at least aware of the dotenv file. If not see this great medium article on &lt;a href="https://medium.com/@rafaelvidaurre/managing-environment-variables-in-node-js-2cb45a55195f" rel="noopener noreferrer"&gt;Managing environment variables in Node.js – Rafael Vidaurre – Medium&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;The big problem with storing sensitive information inside a git repository is that you could push and leak these keys (more so for open source projects). Because of this most gitignore file templates include all files with &lt;code&gt;.env&lt;/code&gt; extensions as a precaution.&lt;/p&gt;

&lt;p&gt;Now security is out of the way, what about convenience. When you first clone a project that depends on a &lt;code&gt;.env&lt;/code&gt; file you have to A) know the environment variables that the project expects or B) copy from an env example file or readme and fill in the contents manually.&lt;/p&gt;

&lt;p&gt;This could be much more streamlined which is why I have published an npm package &lt;a href="https://www.npmjs.com/package/envup" rel="noopener noreferrer"&gt;envup&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fzw4jebsuzdsmhucrg6kc.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fzw4jebsuzdsmhucrg6kc.png" alt="Example" width="800" height="544"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;This tool allows you to create an &lt;code&gt;env.json&lt;/code&gt; file in the root of your project containing the contents of your environment file and then configure it with one command.&lt;/p&gt;

&lt;p&gt;This allows you to keep your env file ignored and also make it easy for others to configure their environment too!&lt;/p&gt;

</description>
      <category>discuss</category>
      <category>node</category>
      <category>dotenv</category>
    </item>
  </channel>
</rss>
