Socket
Socket
Sign inDemoInstall

ansi-regex

Package Overview
Dependencies
Maintainers
2
Versions
18
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ansi-regex

Regular expression for matching ANSI escape codes


Version published
Weekly downloads
171M
increased by7.08%
Maintainers
2
Weekly downloads
 
Created

What is ansi-regex?

The ansi-regex npm package is used to create regular expressions to match ANSI escape codes, which are used to format output in terminal with colors, background colors, styles like bold or underline, and other text effects.

What are ansi-regex's main functionalities?

Matching ANSI escape codes

This code sample demonstrates how to use ansi-regex to match ANSI escape codes in a string. The string contains the ANSI escape codes for underlining text, followed by the word 'cake', and then the reset code to stop the underlining. The ansiRegex function is called to generate a regular expression that matches these codes.

"\u001B[4mcake\u001B[0m".match(ansiRegex());

Other packages similar to ansi-regex

Keywords

FAQs

Package last updated on 09 Sep 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc