Open
Description
The preferred method of determining whether Node.js is being run within a TTY context is to check that the value of the process.stdout.isTTY property is true:
$ node -p -e "Boolean(process.stdout.isTTY)" true $ node -p -e "Boolean(process.stdout.isTTY)" | cat false
https://nodejs.org/api/tty.html#tty
Line 1 in 20fc196
Line 15 in 20fc196
globalThis.process?.stdout?.isTTY && env.TERM && !isDumbTerminal
This would also remove the dependency on the node:tty
module and make it "more easier" for use in the browser. i.e. NO TRANSPILATION required, you can just import ... from "./node_modules/colorette/index.js"