title: Pass the same parameters to node for multiple scripts in package.json
body: <p>In my <code>package.json</code>, I have several scripts that call <code>node</code> with the same parameters over and over. To simplify that invocation, I've created a <code>package.json</code> variable, and am invoking the scripts like this:</p>
  <pre class="lang-json prettyprint-override"><code>{
    &quot;nodeParams&quot;: &quot;--experimental-specifier-resolution=node --harmony -r source-map-support/register&quot;,
    &quot;scripts&quot;: {
      &quot;dothis&quot;: &quot;node $npm_package_nodeParams myscript.js&quot;,
      &quot;dothat&quot;: &quot;node $npm_package_nodeParams another-script.js&quot;,
      ...
    }
  }
  </code></pre>
  <p>This is quite common for calling compiled TypeScript code, and worked fine in NPM v6.</p>
  <p>However, it no longer works in NPM v7 due to <a href="https://blog.npmjs.org/post/626173315965468672/npm-v7-series-beta-release-and-semver-major" rel="nofollow noreferrer">a breaking change</a>:</p>
  <blockquote>
  <p><a href="https://github.com/npm/rfcs/blob/latest/implemented/0021-reduce-lifecycle-script-environment.md" rel="nofollow noreferrer">RFC 21</a> Environment no longer includes npm_package_* fields</p>
  </blockquote>
  <p>What is <a href="https://github.com/npm/rfcs/issues/305" rel="nofollow noreferrer">the currently recommended solution</a>, or some alternative?</p>