Socket
Socket
Sign inDemoInstall

strip-ansi

Package Overview
Dependencies
1
Maintainers
2
Versions
20
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

strip-ansi

Strip ANSI escape codes


Version published
Maintainers
2
Weekly downloads
153,482,749
decreased by-9.76%

Weekly downloads

Package description

What is strip-ansi?

The strip-ansi npm package is used to remove ANSI escape codes from strings. These codes are often used to provide coloring and formatting in terminal output, but they can be problematic when the text needs to be processed without these codes, such as logging to a file or displaying in a GUI.

What are strip-ansi's main functionalities?

Strip ANSI escape codes from a string

This feature allows you to remove any ANSI escape codes from a given string, leaving only the plain text without any formatting or color.

const stripAnsi = require('strip-ansi');
const coloredString = '\u001B[4mUnicorn\u001B[0m';
const strippedString = stripAnsi(coloredString);
console.log(strippedString); // 'Unicorn'

Other packages similar to strip-ansi

Readme

Source

strip-ansi Build Status

Strip ANSI escape codes


Get professional support for 'strip-ansi' with a Tidelift subscription
Tidelift helps make open source sustainable for maintainers while giving companies
assurances about security, maintenance, and licensing for their dependencies.

Install

$ npm install strip-ansi

Usage

const stripAnsi = require('strip-ansi');

stripAnsi('\u001B[4mUnicorn\u001B[0m');
//=> 'Unicorn'
  • strip-ansi-cli - CLI for this module
  • strip-ansi-stream - Streaming version of this module
  • has-ansi - Check if a string has ANSI escape codes
  • ansi-regex - Regular expression for matching ANSI escape codes
  • chalk - Terminal string styling done right

Maintainers

License

MIT

Keywords

FAQs

Last updated on 29 Sep 2018

Did you know?

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc