title: does Node kill spawned child processes automatically?
body: <p>In the documentation for <a href="https://nodejs.org/api/child_process.html" rel="nofollow noreferrer">Node's Child Processes</a>, there is this sentence in the section on <code>child_process.spawn()</code>:</p>
  
  <blockquote>
    <p>On Windows, setting <code>options.detached</code> to <code>true</code> makes it possible for the
    child process to continue running after the parent exits.</p>
  </blockquote>
  
  <p>That makes it sound like (at least on Windows) when you leave <code>options.detached</code> to the default value of <code>false</code>, <code>spawn()</code>'d processes will automatically be killed. That's actually the behavior I want in my application, and in fact I was calling <code>myChildProcess.kill( "SIGINT" )</code> in my code, but commented it out, and the child processes still went away when my app quit. So that's great, but:</p>
  
  <p>(1) My understanding is that it's necessary to do some tricky stuff with "job objects" as discussed <a href="https://stackoverflow.com/questions/3342941/kill-child-process-when-parent-process-is-killed">here</a> in order to make this work on Windows. Do you know if Node is doing something tricky like that to make child processes go away? Or perhaps it's more simple than that and Node just keeps a list of the spawned process IDs and kills any of them that are still around when shutting down? Which leads to the closely related question...</p>
  
  <p>(2) If Node is indeed doing something special to kill child processes, do you know if there are cases (e.g., some kind of app crash) that would defeat what it's doing and leave the child processes running?</p>
  
  <p><strong>UPDATE</strong>: To clarify, the child processes I'm launching in my case are Python web server processes, not other Node processes. I don't know if there's a difference in behavior between a Node child process and some other child process for the purpose of this question.</p>