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 initansis 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.
Instances no longer share styles across different color levels, so each instance renders at its own level.
Calling .extend() now changes styles only on the instance on which it is called.
reset prepends the reset code and no longer appends a closing reset; add one explicitly if needed.
strip() now removes OSC 8 hyperlink sequences and returns plain text.
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.
New APIs and options 2
Added a constructor overload that accepts a mock globalThis object for controlled color auto-detection.
Added link(url, text?) for OSC 8 hyperlinks supported by many terminal emulators.
Fixes and other changes 1
When no colors are detected, the fallback is 16 colors instead of truecolor.