title: How to disable warnings when node is launched via a (global) shell script
body: <p>I am building a CLI tool with node, and want to use the <code>fs.promise</code> API. However, when the app is launched, there's always an <code>ExperimentalWarning</code>, which is super annoying and messes up with the interaction prompts. How can I disable this warning/all warnings?</p>
  
  <p>I'm testing this with the latest node v10 lts release on Windows 10.</p>
  
  <p>To use the CLI tool globally, I have added this to my <code>package.json</code> file: </p>
  
  <pre><code>    { 
        //...
        "preferGlobal": true,
        "bin": { "myapp" : "./index.js" }
        //...
      }
  </code></pre>
  
  <p>And have run <code>npm link</code> to link the <code>./index.js</code> script. Then I am able to run the app globally simply with <code>myapp</code>.</p>
  
  <p>After some research I noticed that there are generally 2 ways to disable the warnings:</p>
  
  <ol>
  <li>set environmental variable <code>NODE_NO_WARNINGS=1</code></li>
  <li>call the script with <code>node --no-warnings ./index.js</code></li>
  </ol>
  
  <p>Although I was able to disable the warnings with the 2 methods above, there seems to be no way to do that while directly running <code>myapp</code> command.</p>
  
  <p>The shebang I placed in the entrance script <code>./index.js</code> is:</p>
  
  <pre><code>#!/usr/bin/env node
  
  
  // my code...
  </code></pre>
  
  <p>I have also read other discussions on modifying the shebang, but haven't found a universal/cross-platform way to do this - to either pass argument to node itself, or set the env variable.</p>
  
  <p>If I publish this npm package, it would be great if there's a way to make sure the warnings of this single package are disabled in advance, instead of having each individual user tweak their environment themselves. Is there any hidden npm <code>package.json</code> configs that allow this?</p>
  
  <p>Any help would be greatly appreciated!</p>