Is it possible to start and continue to capture output from a certain bash process with node? For example: say I was run tail /some/file, how can I keep listening to every new line printed and act on the output?
Is it possible to start and continue to capture output from a certain bash
Share
For completeness, I’ve added this answer as well.
You can use
child_process.spawnto spawn a process and monitor it’s output. However, for a command like tail, cat, etc that don’t run long or continuously you can just usechild_process.execand it will capture the entire output forstdoutandstderrand give it to you all at once.