strip-ansi 4.0.0 → 6.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (4) hide show
  1. package/index.d.ts +17 -0
  2. package/index.js +1 -1
  3. package/package.json +52 -50
  4. package/readme.md +12 -5
package/index.d.ts ADDED
@@ -0,0 +1,17 @@
1
+ /**
2
+ Strip [ANSI escape codes](https://en.wikipedia.org/wiki/ANSI_escape_code) from a string.
3
+
4
+ @example
5
+ ```
6
+ import stripAnsi = require('strip-ansi');
7
+
8
+ stripAnsi('\u001B[4mUnicorn\u001B[0m');
9
+ //=> 'Unicorn'
10
+
11
+ stripAnsi('\u001B]8;;https://github.com\u0007Click\u001B]8;;\u0007');
12
+ //=> 'Click'
13
+ ```
14
+ */
15
+ declare function stripAnsi(string: string): string;
16
+
17
+ export = stripAnsi;
package/index.js CHANGED
@@ -1,4 +1,4 @@
1
1
  'use strict';
2
2
  const ansiRegex = require('ansi-regex');
3
3
 
4
- module.exports = input => typeof input === 'string' ? input.replace(ansiRegex(), '') : input;
4
+ module.exports = string => typeof string === 'string' ? string.replace(ansiRegex(), '') : string;
package/package.json CHANGED
@@ -1,52 +1,54 @@
1
1
  {
2
- "name": "strip-ansi",
3
- "version": "4.0.0",
4
- "description": "Strip ANSI escape codes",
5
- "license": "MIT",
6
- "repository": "chalk/strip-ansi",
7
- "author": {
8
- "name": "Sindre Sorhus",
9
- "email": "sindresorhus@gmail.com",
10
- "url": "sindresorhus.com"
11
- },
12
- "engines": {
13
- "node": ">=4"
14
- },
15
- "scripts": {
16
- "test": "xo && ava"
17
- },
18
- "files": [
19
- "index.js"
20
- ],
21
- "keywords": [
22
- "strip",
23
- "trim",
24
- "remove",
25
- "ansi",
26
- "styles",
27
- "color",
28
- "colour",
29
- "colors",
30
- "terminal",
31
- "console",
32
- "string",
33
- "tty",
34
- "escape",
35
- "formatting",
36
- "rgb",
37
- "256",
38
- "shell",
39
- "xterm",
40
- "log",
41
- "logging",
42
- "command-line",
43
- "text"
44
- ],
45
- "dependencies": {
46
- "ansi-regex": "^3.0.0"
47
- },
48
- "devDependencies": {
49
- "ava": "*",
50
- "xo": "*"
51
- }
2
+ "name": "strip-ansi",
3
+ "version": "6.0.0",
4
+ "description": "Strip ANSI escape codes from a string",
5
+ "license": "MIT",
6
+ "repository": "chalk/strip-ansi",
7
+ "author": {
8
+ "name": "Sindre Sorhus",
9
+ "email": "sindresorhus@gmail.com",
10
+ "url": "sindresorhus.com"
11
+ },
12
+ "engines": {
13
+ "node": ">=8"
14
+ },
15
+ "scripts": {
16
+ "test": "xo && ava && tsd"
17
+ },
18
+ "files": [
19
+ "index.js",
20
+ "index.d.ts"
21
+ ],
22
+ "keywords": [
23
+ "strip",
24
+ "trim",
25
+ "remove",
26
+ "ansi",
27
+ "styles",
28
+ "color",
29
+ "colour",
30
+ "colors",
31
+ "terminal",
32
+ "console",
33
+ "string",
34
+ "tty",
35
+ "escape",
36
+ "formatting",
37
+ "rgb",
38
+ "256",
39
+ "shell",
40
+ "xterm",
41
+ "log",
42
+ "logging",
43
+ "command-line",
44
+ "text"
45
+ ],
46
+ "dependencies": {
47
+ "ansi-regex": "^5.0.0"
48
+ },
49
+ "devDependencies": {
50
+ "ava": "^2.4.0",
51
+ "tsd": "^0.10.0",
52
+ "xo": "^0.25.3"
53
+ }
52
54
  }
package/readme.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # strip-ansi [![Build Status](https://travis-ci.org/chalk/strip-ansi.svg?branch=master)](https://travis-ci.org/chalk/strip-ansi)
2
2
 
3
- > Strip [ANSI escape codes](https://en.wikipedia.org/wiki/ANSI_escape_code)
3
+ > Strip [ANSI escape codes](https://en.wikipedia.org/wiki/ANSI_escape_code) from a string
4
4
 
5
5
 
6
6
  ## Install
@@ -17,12 +17,23 @@ const stripAnsi = require('strip-ansi');
17
17
 
18
18
  stripAnsi('\u001B[4mUnicorn\u001B[0m');
19
19
  //=> 'Unicorn'
20
+
21
+ stripAnsi('\u001B]8;;https://github.com\u0007Click\u001B]8;;\u0007');
22
+ //=> 'Click'
20
23
  ```
21
24
 
22
25
 
26
+ ## strip-ansi for enterprise
27
+
28
+ Available as part of the Tidelift Subscription.
29
+
30
+ The maintainers of strip-ansi and thousands of other packages are working with Tidelift to deliver commercial support and maintenance for the open source dependencies you use to build your applications. Save time, reduce risk, and improve code health, while paying the maintainers of the exact dependencies you use. [Learn more.](https://tidelift.com/subscription/pkg/npm-strip-ansi?utm_source=npm-strip-ansi&utm_medium=referral&utm_campaign=enterprise&utm_term=repo)
31
+
32
+
23
33
  ## Related
24
34
 
25
35
  - [strip-ansi-cli](https://github.com/chalk/strip-ansi-cli) - CLI for this module
36
+ - [strip-ansi-stream](https://github.com/chalk/strip-ansi-stream) - Streaming version of this module
26
37
  - [has-ansi](https://github.com/chalk/has-ansi) - Check if a string has ANSI escape codes
27
38
  - [ansi-regex](https://github.com/chalk/ansi-regex) - Regular expression for matching ANSI escape codes
28
39
  - [chalk](https://github.com/chalk/chalk) - Terminal string styling done right
@@ -33,7 +44,3 @@ stripAnsi('\u001B[4mUnicorn\u001B[0m');
33
44
  - [Sindre Sorhus](https://github.com/sindresorhus)
34
45
  - [Josh Junon](https://github.com/qix-)
35
46
 
36
-
37
- ## License
38
-
39
- MIT