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.
- package/index.d.ts +17 -0
- package/index.js +1 -1
- package/package.json +52 -50
- 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
package/package.json
CHANGED
|
@@ -1,52 +1,54 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
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 [](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
|