Packages

ansis

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

Your version

1.5.5

22 Sep 2022Where it was published

1.5.6 is the newest release of 1.x.

In short

7 new3 fixed1 internal

Release note

Cumulative Release v1.3.0 - v1.5.5

Features

  • Added support for nested template literal syntax:

    console.log(red`red ${yellow`yellow ${green`green`} yellow`} red`)
  • Added named export of colors with support for chained syntax:

    import { red, green, yellow } from 'ansis/colors';
    console.log(red.bold.underline`text`);
  • Added extending of base colors with named custom truecolor:

    import ansis from 'ansis';
    ansis.extend({ orange: '#FFAB40' });
    console.log(ansis.orange.bold('text'));
  • Added the strip() method to remove all ANSI codes from string

  • Added support for both CommonJS and ESM

  • Added aliases: .fg() for .ansi256() and .bg() for .bgAnsi256() methods

  • Optimized distributed code size to less than 4 KB.

Bug Fixes

  • Fixed visible style with nested template strings

  • Set correct aliases for bgAnsi and fg methods by named export

  • Regard the value of the environment variable FORCE_COLOR=0 to force disable colors