summaryrefslogtreecommitdiff
path: root/tools/node_modules/eslint/node_modules/ansi-regex/readme.md
diff options
context:
space:
mode:
Diffstat (limited to 'tools/node_modules/eslint/node_modules/ansi-regex/readme.md')
-rw-r--r--tools/node_modules/eslint/node_modules/ansi-regex/readme.md41
1 files changed, 41 insertions, 0 deletions
diff --git a/tools/node_modules/eslint/node_modules/ansi-regex/readme.md b/tools/node_modules/eslint/node_modules/ansi-regex/readme.md
index 22db1c3405..d19c44667e 100644
--- a/tools/node_modules/eslint/node_modules/ansi-regex/readme.md
+++ b/tools/node_modules/eslint/node_modules/ansi-regex/readme.md
@@ -2,6 +2,20 @@
> Regular expression for matching [ANSI escape codes](https://en.wikipedia.org/wiki/ANSI_escape_code)
+---
+
+<div align="center">
+ <b>
+ <a href="https://tidelift.com/subscription/pkg/npm-ansi-regex?utm_source=npm-ansi-regex&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>
+
+---
+
## Install
@@ -23,9 +37,31 @@ ansiRegex().test('cake');
'\u001B[4mcake\u001B[0m'.match(ansiRegex());
//=> ['\u001B[4m', '\u001B[0m']
+
+'\u001B[4mcake\u001B[0m'.match(ansiRegex({onlyFirst: true}));
+//=> ['\u001B[4m']
+
+'\u001B]8;;https://github.com\u0007click\u001B]8;;\u0007'.match(ansiRegex());
+//=> ['\u001B]8;;https://github.com\u0007', '\u001B]8;;\u0007']
```
+## API
+
+### ansiRegex([options])
+
+Returns a regex for matching ANSI escape codes.
+
+#### options
+
+##### onlyFirst
+
+Type: `boolean`<br>
+Default: `false` *(Matches any ANSI escape codes in a string)*
+
+Match only the first ANSI escape.
+
+
## FAQ
### Why do you test for codes not in the ECMA 48 standard?
@@ -35,6 +71,11 @@ Some of the codes we run as a test are codes that we acquired finding various li
On the historical side, those ECMA standards were established in the early 90's whereas the VT100, for example, was designed in the mid/late 70's. At that point in time, control codes were still pretty ungoverned and engineers used them for a multitude of things, namely to activate hardware ports that may have been proprietary. Somewhere else you see a similar 'anarchy' of codes is in the x86 architecture for processors; there are a ton of "interrupts" that can mean different things on certain brands of processors, most of which have been phased out.
+## Security
+
+To report a security vulnerability, please use the [Tidelift security contact](https://tidelift.com/security). Tidelift will coordinate the fix and disclosure.
+
+
## Maintainers
- [Sindre Sorhus](https://github.com/sindresorhus)