Packages

ansis

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

Your version

3.0.0

major29 Mar 2024Where it was published

3.17.0 is the newest release of 3.x.

In short

11 breaking3 new

  • breaking

    faint (alias for dim), replace in your code with dim

  • breaking

    doubleUnderline, replace in your code with underline

  • breaking

    frame, replace in your code with underline

  • breaking

    encircle, replace in your code with underline

  • breaking

    overline, replace in your code with underline

  • breaking

    ansi, replace in your code with ansi256 or fg

  • breaking

    bgAnsi, replace in your code with bgAnsi256 or bg

  • breaking

    ansi256 and fg (alias to ansi256) - expected a code in the range 0 - 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 with dim

  • breaking

    doubleUnderline, replace in your code with underline

  • breaking

    frame, replace in your code with underline

  • breaking

    encircle, replace in your code with underline

  • breaking

    overline, replace in your code with underline

Deleted methods

The methods are deleted:

  • breaking

    ansi, replace in your code with ansi256 or fg

  • breaking

    bgAnsi, replace in your code with bgAnsi256 or bg

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

    ansi256 and fg (alias to ansi256) - expected a code in the range 0 - 255

  • breaking

    bgAnsi256 and bg (alias to bgAnsi256) - expected a code in the range0 - 255

  • breaking

    rgb - expected r, g, b values in the range 0 - 255

  • breaking

    bgRgb - expected r, g, b values in the range 0 - 255