ansis
4.5.0 · 1 Nov 2026ISC56.7M / weekRepositoryHomepagenpmAtom feed
3.17.0 is the newest release of 3.x.
In short
11 breaking3 new
- breaking
faint(alias for dim), replace in your code withdim - breaking
doubleUnderline, replace in your code withunderline - breaking
frame, replace in your code withunderline - breaking
encircle, replace in your code withunderline - breaking
overline, replace in your code withunderline - breaking
ansi, replace in your code withansi256orfg - breaking
bgAnsi, replace in your code withbgAnsi256orbg - breaking
ansi256andfg(alias to ansi256) - expected a code in the range0 - 255
Release note
Features
Added detection of color spaces support: TrueColor, 256 colors, 16 colors, no color (black & white).
Added fallback for supported color space: truecolor —> 256 colors —> 16 colors —> no colors.
Improved performance for the
hex()function.
Breaking change
In the new major version 3.x are removed unused styles and methods.
⚠️ Warning
Before update, please check your code whether is used deleted styles and methods.
Support Node.js
Drop supports for Node <= 14. Minimal supported version is 15.0.0 (Released 2020-10-20).
In the theory the v3 can works with Node12, but we can't test it.
Deleted styles
The not widely supported styles are deleted:
- breaking
faint(alias for dim), replace in your code withdim - breaking
doubleUnderline, replace in your code withunderline - breaking
frame, replace in your code withunderline - breaking
encircle, replace in your code withunderline - breaking
overline, replace in your code withunderline
Deleted methods
The methods are deleted:
- breaking
ansi, replace in your code withansi256orfg - breaking
bgAnsi, replace in your code withbgAnsi256orbg
Deleted clamp in functions
The clamp (0, 255) for the ANSI 256 codes and RGB values is removed, because is unused.
You should self check the function arguments.
The affected functions:
- breaking
ansi256andfg(alias to ansi256) - expected a code in the range0 - 255 - breaking
bgAnsi256andbg(alias to bgAnsi256) - expected a code in the range0 - 255 - breaking
rgb- expected r, g, b values in the range0 - 255 - breaking
bgRgb- expected r, g, b values in the range0 - 255