Say I writing a cli task runner that runs node processes with spawn. If I want to pipe the output to the stdout (so I can intercept the data and process if necessary), tty will not be set. And then you have to do some complicated stuff with drawback like native deps (https://stackoverflow.com/questions/31866207/spawning-a-child-process-with-tty-in-node-js) to emulate a tty (or maybe there is an easier way).
So isTTY doesn't seem like is prevents supporting colors. Or is this the only way to detect cat file | node app or something?
Say I writing a cli task runner that runs node processes with spawn. If I want to pipe the output to the stdout (so I can intercept the data and process if necessary), tty will not be set. And then you have to do some complicated stuff with drawback like native deps (https://stackoverflow.com/questions/31866207/spawning-a-child-process-with-tty-in-node-js) to emulate a tty (or maybe there is an easier way).
So isTTY doesn't seem like is prevents supporting colors. Or is this the only way to detect
cat file | node appor something?