unstale

npm / ansis

ansis

What changed in ansis 4, from its official release notes, upgrade guides and advisories. Sources checked 2026-10-20.

6 breaking2 new APIs and options1 fixes and other

See which of these apply to your code, ranked, in your agent:

npx @unstale/cli init

@unstale/cli 0.2.8 on npm

ansis 49 changes

Breaking changes 6

  • During automatic color detection, TERM=dumb now disables colors before COLORTERM, CI, PM2, Next.js runtime, and platform-specific checks; FORCE_COLOR can still explicitly enable colors.

    4.4.0release notes

  • Instances no longer share styles across different color levels, so each instance renders at its own level.

    4.3.1release notes

  • Calling .extend() now changes styles only on the instance on which it is called.

    4.3.1release notes

  • reset prepends the reset code and no longer appends a closing reset; add one explicitly if needed.

    4.3.1release notes

  • strip() now removes OSC 8 hyperlink sequences and returns plain text.

    4.3.1release notes

  • Color detection now gives FORCE_COLOR priority over NO_COLOR, CLI color flags priority over NO_COLOR, FORCE_COLOR priority over --no-color, and lets the last CLI color flag win.

    4.3.0release notes

New APIs and options 2

  • Added a constructor overload that accepts a mock globalThis object for controlled color auto-detection.

    4.3.0release notes

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

    4.3.0release notes

Fixes and other changes 1

  • When no colors are detected, the fallback is 16 colors instead of truecolor.

    4.3.0release notes