For AI agents: the complete documentation index is available at /en/llms.txt, the full documentation bundle is available at /en/llms-full.txt, and this page is available as Markdown at /en/reference/sdk/logs/functions/supportsColor.md.
  • English
  • Function: supportsColor()

    function supportsColor(stream: {
      isTTY?: boolean;
    }): boolean;

    Defined in: logs/ansi.ts:46

    检测输出流是否支持彩色输出(遵循 NO_COLOR 与 FORCE_COLOR 环境变量行业规范)。

    Parameters

    ParameterTypeDescription
    stream{ isTTY?: boolean; }目标输出流对象(如 process.stdout)。
    stream.isTTY?boolean-

    Returns

    boolean

    是否支持色彩输出。