There's code out there that checks whether stdout is a tty by doing an instanceof check, e.g. in angular: https://github.com/angular/angular-cli/blob/d66aaa3ca458e05b535bec7c1dcb98b0e9c5202e/packages/angular/cli/src/utilities/color.ts#L14-L16
There's code out there that checks whether stdout is a tty by doing an instanceof check, e.g. in angular: https://github.com/angular/angular-cli/blob/d66aaa3ca458e05b535bec7c1dcb98b0e9c5202e/packages/angular/cli/src/utilities/color.ts#L14-L16