title: Node.js command line script sometimes does not terminate
body: <p>I have a node js script with an async main method. Sometimes the script terminates fine, other times it hangs.</p>
  
  <pre><code>const main = async () =&gt; {
      let updates = []
      // ... add a bunch of promises to updates
      await Promise.all(updates)
  } 
  
  main()
  </code></pre>
  
  <p>Does anyone know why this script sometimes might hang? It just doesn't terminate though it appears to have run to completion.</p>