UNPKG

tiny-colors

Version:

A tiny library providing the basic ANSI colors for the terminal.

7 lines (6 loc) 383 B
/* MAIN */ const ENV = globalThis.process?.env || {}; const ARGV = globalThis.process?.argv || []; const ENABLED = !('NO_COLOR' in ENV) && (ENV.COLOR !== '0') && (ENV.TERM !== 'dumb') && !ARGV.includes('--no-color') && !ARGV.includes('--no-colors') && (ENV.COLOR === '1' || !globalThis.process?.stdout || globalThis.process?.stdout?.isTTY === true); /* EXPORT */ export { ENABLED };