title: How to run C++ program or any other program using spawn in node.js along with input file from which stdin is to be read
body: <p>I am trying to run a C++ program from within node.js using the spawn method. The normal way when I try to run just the .exe file by specifying: pchild = spawn(exefilename) works but I am looking for a way to run the exe so that the stdin is read from input file. In cmd, the command is : exefilename &lt; inputfilename. I am looking for an equivalent in spawn.</p>