Socket
Socket
Sign inDemoInstall

has-ansi

Package Overview
Dependencies
1
Maintainers
2
Versions
11
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 3.0.0 to 4.0.0

6

index.js
'use strict';
const ansiRegex = require('ansi-regex');
// Remove the `g` flag
const re = new RegExp(ansiRegex().source);
// Removes the `g` flag
const regex = new RegExp(ansiRegex().source);
module.exports = input => re.test(input);
module.exports = string => regex.test(string);
{
"name": "has-ansi",
"version": "3.0.0",
"description": "Check if a string has ANSI escape codes",
"license": "MIT",
"repository": "chalk/has-ansi",
"author": {
"name": "Sindre Sorhus",
"email": "sindresorhus@gmail.com",
"url": "sindresorhus.com"
},
"engines": {
"node": ">=4"
},
"scripts": {
"test": "xo && ava"
},
"files": [
"index.js"
],
"keywords": [
"ansi",
"styles",
"color",
"colour",
"colors",
"terminal",
"console",
"string",
"tty",
"escape",
"shell",
"xterm",
"command-line",
"text",
"regex",
"regexp",
"re",
"match",
"test",
"find",
"pattern",
"has"
],
"dependencies": {
"ansi-regex": "^3.0.0"
},
"devDependencies": {
"ava": "*",
"xo": "*"
}
"name": "has-ansi",
"version": "4.0.0",
"description": "Check if a string has ANSI escape codes",
"license": "MIT",
"repository": "chalk/has-ansi",
"author": {
"name": "Sindre Sorhus",
"email": "sindresorhus@gmail.com",
"url": "sindresorhus.com"
},
"engines": {
"node": ">=8"
},
"scripts": {
"test": "xo && ava"
},
"files": [
"index.js"
],
"keywords": [
"ansi",
"styles",
"color",
"colour",
"colors",
"terminal",
"console",
"string",
"tty",
"escape",
"shell",
"xterm",
"command-line",
"text",
"regex",
"regexp",
"match",
"test",
"find",
"pattern",
"has"
],
"dependencies": {
"ansi-regex": "^4.1.0"
},
"devDependencies": {
"ava": "^2.3.0",
"xo": "^0.24.0"
}
}

@@ -39,4 +39,13 @@ # has-ansi [![Build Status](https://travis-ci.org/chalk/has-ansi.svg?branch=master)](https://travis-ci.org/chalk/has-ansi)

## License
MIT
---
<div align="center">
<b>
<a href="https://tidelift.com/subscription/pkg/npm-has-ansi?utm_source=npm-has-ansi&utm_medium=referral&utm_campaign=readme">Get professional support for this package with a Tidelift subscription</a>
</b>
<br>
<sub>
Tidelift helps make open source sustainable for maintainers while giving companies<br>assurances about security, maintenance, and licensing for their dependencies.
</sub>
</div>
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