title: What's the best way to find default gateway IP in Node.js?
body: <p>What's the best way nowadays to find the default gateway IP Address in Node.js?</p>
  
  <p><code>os.networkInterfaces()</code> doesn't provide this info.</p>
  
  <p>The only idea coming in mind is to parse the <em>stdout</em> of a subprocess <code>route -n</code>:</p>
  
  <pre><code>Kernel IP routing table
  Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
  0.0.0.0         192.168.1.2     0.0.0.0         UG    100    0        0 eth0
  192.168.1.0     0.0.0.0         255.255.255.0   U     0      0        0 eth0
  </code></pre>