🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
DemoInstallSign in
Socket

ansis

Package Overview
Dependencies
Maintainers
1
Versions
112
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ansis - npm Package Versions

1
35
11

4.0.0-beta.4

Diff
webdiscus
published 4.0.0-beta.4 •

Changelog

Source

4.0.0-beta.4 (2025-03-08)

Features

Dropped 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 use TERM=xterm-256color along with COLORTERM=truecolor to indicate truecolor support.

webdiscus
published 4.0.0-beta.3 •
webdiscus
published 4.0.0-beta.2 •

Changelog

Source

4.0.0-beta.2 (2025-03-07)

Fixes

Defaults to 16 colors when terminal color support is unknown

Ansis now defaults uses 16 colors if it cannot detect support for 256 colors or truecolor.

  • Old behavior: Unknown terminal → used truecolor (could result in incorrect colors)
  • New behavior: Unknown terminal → uses only 16 colors (ensures broad compatibility)

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() or rgb(). To explicitly enable truecolor, set the environment variable COLORTERM=24bit or FORCE_COLOR=3.

webdiscus
published 4.0.0-beta.1 •

Changelog

Source

4.0.0-beta.1 (2025-03-03)

BREAKING CHANGE (very unlikely impact): Removed non-standard strike style (alias for strikethrough)

The legacy strike alias has been removed to clean up the API and stay consistent with ANSI style conventions.

  • The strike style was rarely (if ever) used and added unnecessary redundancy.
  • No usage of ansis.strike() was found in public GitHub repositories.
  • Other ANSI libraries use the standard strikethrough name exclusively.

Migrating

If you're using strike style, replace it with strikethrough.

Features

Support escape sequences in tagged template literals

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
webdiscus
published 4.0.0-beta.0 •

Changelog

Source

4.0.0-beta.0 (2025-03-02)

Deprecated.

webdiscus
published 3.17.0 •

Changelog

Source

3.17.0 (2025-03-02)

  • feat: add support for 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.
webdiscus
published 3.16.0 •

Changelog

Source

3.16.0 (2025-02-21)

  • chore: after testing bump version to release version 3.16.0
webdiscus
published 3.16.0-beta.3 •

Changelog

Source

3.16.0-beta.3 (2025-02-21)

  • chore: revert the full text of ISC license from https://opensource.org/license/isc-license-txt
webdiscus
published 3.16.0-beta.2 •
webdiscus
published 3.16.0-beta.1 •