This question is essentially the exact duplicate of this question, but that is a 2+ year old question and hasn't been properly answered yet.
How do I get the stdin/stdout of an existing running process that Node.js didn't spawn with child_process (or has spawned it with child_process, but let it run detached (and then stopped/crashed, and had to restart))?