ansi-regex is a compact and efficient JavaScript package designed to match ANSI escape codes within strings. These escape codes are commonly used for terminal styling, such as colors and formatting. The package provides a regular expression that can reliably identify and isolate these codes, allowing developers to easily strip them from text or process them separately, ensuring cleaner and more predictable output in various applications. It is widely used in terminal-related utilities and text processing scripts.
Ansi-regex has been infrequently updated since its initial releases in 2014. Releases were more common in earlier years, slowing significantly after 2019. There were multiple releases in 2021 and 2022 where older versions of the package were updated. The most recent update happened in August 2025 with version 6.2.0.
Ansi-regex npm package downloads show a general upward trend from March 2024 to September 2025. Downloads significantly increased in late 2024 and continued rising through mid-2025, peaking in July 2025. August 2025 saw a decrease, and September 2025's incomplete data suggests the high downloads may continue.