Packages

ansis

4.5.0 · 1 Nov 2026ISC56.7M / weekRepositoryHomepagenpmAtom feed

Your version

4.3.0

11 May 2026Where it was published

4.5.0 is the newest release of 4.x.

In short

2 new

Release note

Features

  • Added link(url, text?) for OSC 8 hyperlinks, supported by many terminal emulators, #44

  • Added constructor overload to pass a mock globalThis object for controlled color auto-detection, #47

    import { Ansis } from 'ansis';
    
    const color = new Ansis({
      process: {
        env: { FORCE_COLOR: '1' },
        argv: ['node', 'app.js'],
        stdout: { isTTY: false },
        platform: 'linux',
      },
    });
    
    console.log(color.level); // 1

Bugfix

Fixed the handling edge cases for using ENV variables and CLI flags, #46

Fixed edge caseOld behavior (bug)New behavior (correct)
FORCE_COLOR=1, NO_COLOR=1disable colorenable color (FORCE_COLOR takes precedence over NO_COLOR)
NO_COLOR=1, --colordisable colorenable color (CLI color flags take precedence over NO_COLOR)
FORCE_COLOR=1, --no-colordisable colorenable color (FORCE_COLOR has the highest priority)
--no-color --colordisable colorenable color (last flag wins)
--color with no detected colorstruecolor16 colors (auto-detect fallback uses the minimum color level, not truecolor)