title: Running a node.js process in background after giving inputs to it
body: <p>I have this node.js server which, once spawned, expects some input from stdin. The inputs shouldn't be given straight away: I need to wait for some event before giving them (e.g. a connection from somebody). If I give the commands and close the shell, the server shuts itself down. I would like to give the input to the server and close my shell (effectively leaving the server running).</p>
  
  <p>I know that to run a process in background I need to do for example <code>node my_server.js &amp;</code>, but this prevents the input from the command line. I would like to give this input AND then put it in background. Modules like <code>forever</code> puts it in the background automatically without letting me giving the inputs through stdin.</p>
  
  <p>Moreover putting the script in background kills anyways the server when closing the shell.</p>
  
  <p>Any suggestion?</p>
  
  <p>Thanks</p>