Detect whether a terminal supports ANSI escape sequences
npm install --save supports-ansi
const supportsAnsi = require('supports-ansi');
// on ANSI/VT100/xterm compatible terminal
console.log(supportsAnsi);
// => true
// on CMD/PowerShell (before Windows 10 v.1607)
console.log(supportsAnsi);
// => false
Cygwin is not supported.
MIT