title: How to use (environment) variables for a package.json dependency in npm?
body: <p>In npm, I want to be able to install a package from a private GitHub repo as a dependency through the <code>git+https</code> way without having to hardcode the actual <code>github_username:personal_access_token</code>, but rather plug them into the dependency string as (environment) variables.</p>
  
  <p>So instead of</p>
  
  <p><code>package.json</code>:</p>
  
  <pre><code>...
  "dependencies": {
    ...
    "my-private-github-repo": "git+https://&lt;github_username&gt;:&lt;personal_access_token&gt;@github.com/some/package.git",
    ...
  }
  </code></pre>
  
  <p>I would like something like this:</p>
  
  <p><code>package.json</code>:</p>
  
  <pre><code>...
  "dependencies": {
    ...
    "my-private-github-repo": "git+https://${github_username}:${personal_access_token}@github.com/some/package.git",
    ...
  }
  </code></pre>
  
  <p>Hardcoding credentials is a major no-no when <em>applying version control to</em> <code>package.json</code> which I'd like to be able to do.</p>
  
  <p>What is the best way to do this?</p>