title: How to detect if an --experimental flag is enabled in Node
body: <p>I have some code that needs to work slightly differently depending on whether the <code>--experimental-vm-modules</code> is enabled.</p>
  <p>I'm currently checking for the presence of an object that only exists if the flag is enabled.</p>
  <pre class="lang-js prettyprint-override"><code>function escapePathForImport(path) {
    // If --experimental-vm-modules is enabled
    // (there may be a better way to detect this)
    if (vm.Module) {
      return path;
    }
  
    return escape(path);
  }
  </code></pre>
  <p>That works, but I'm curious if there's a more direct way to detect if a particular <code>--experimental-*</code> flag is enabled.</p>