Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

strip-ansi

Package Overview
Dependencies
Maintainers
2
Versions
20
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

strip-ansi - npm Package Compare versions

Comparing version 7.0.1 to 7.1.0

7

index.js
import ansiRegex from 'ansi-regex';
const regex = ansiRegex();
export default function stripAnsi(string) {

@@ -8,3 +10,6 @@ if (typeof string !== 'string') {

return string.replace(ansiRegex(), '');
// Even though the regex is global, we don't need to reset the `.lastIndex`
// because unlike `.exec()` and `.test()`, `.replace()` does it automatically
// and doing it manually has a performance penalty.
return string.replace(regex, '');
}

2

package.json
{
"name": "strip-ansi",
"version": "7.0.1",
"version": "7.1.0",
"description": "Strip ANSI escape codes from a string",

@@ -5,0 +5,0 @@ "license": "MIT",

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