I have been working on this all day.
The problem is that the STDOUT of your spawned process needs to flush it's output buffer, otherwise it will sit there until it fills up, in which case your code won't execute again.
p.stdin.end() only serves to end the process, which by its very nature, allows the OS to clear up all buffers.
You can't do this from the node as this is not the owner of the output buffer.
It is annoying, but as long as you have control of the script, you can modify it there, perhaps allow it to take a command line option to set an autoflush?
Hope this is of some help.