Changelog
4.0.0-beta.4 (2025-03-08)
xterm-direct
terminfo check for truecolor support (not a breaking change)The xterm-direct
detection logic (introduced in v3.5.0
) has been removed, as it's unnecessary for identifying truecolor-capable terminals.
Note
No terminal emulator sets
TERM=xterm-direct
by default. Modern terminals, including KDE Konsole, typically useTERM=xterm-256color
along withCOLORTERM=truecolor
to indicate truecolor support.
Changelog
4.0.0-beta.2 (2025-03-07)
Ansis now defaults uses 16 colors if it cannot detect support for 256 colors or truecolor.
Note
This is not a breaking change. Ansis gracefully interpolates higher color depths (truecolor and 256 colors) down to 16 colors when using
fg()
,hex()
orrgb()
. To explicitly enable truecolor, set the environment variableCOLORTERM=24bit
orFORCE_COLOR=3
.
Changelog
4.0.0-beta.1 (2025-03-03)
strike
style (alias for strikethrough
)The legacy strike
alias has been removed to clean up the API and stay consistent with ANSI style conventions.
strike
style was rarely (if ever) used and added unnecessary redundancy.ansis.strike()
was found in public GitHub repositories.strikethrough
name exclusively.If you're using strike
style, replace it with strikethrough
.
Ansis now treats tagged template literals the same way as normal strings, returning the same result as the standard function call.
Example with \n
(newline, unescaped):
red('prev\nnext')
red`prev\nnext`
Output:
prev
next
Example with escaped backslash:
red('prev\\next')
red`prev\\next`
Output:
prev\next
Changelog
3.17.0 (2025-03-02)
typescript
< 5.6
to fix TS2526 error:
A 'this' type is available only in a non-static member of a class or interface.
NOTE: If you are already using TypeScript >= 5.6, this update is not required.Changelog
3.16.0 (2025-02-21)
Changelog
3.16.0-beta.3 (2025-02-21)