forked from daren.hsu/line_push
update
This commit is contained in:
+17
@@ -0,0 +1,17 @@
|
||||
/**
|
||||
Strip [ANSI escape codes](https://en.wikipedia.org/wiki/ANSI_escape_code) from a string.
|
||||
|
||||
@example
|
||||
```
|
||||
import stripAnsi = require('strip-ansi');
|
||||
|
||||
stripAnsi('\u001B[4mUnicorn\u001B[0m');
|
||||
//=> 'Unicorn'
|
||||
|
||||
stripAnsi('\u001B]8;;https://github.com\u0007Click\u001B]8;;\u0007');
|
||||
//=> 'Click'
|
||||
```
|
||||
*/
|
||||
declare function stripAnsi(string: string): string;
|
||||
|
||||
export = stripAnsi;
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
'use strict';
|
||||
const ansiRegex = require('ansi-regex');
|
||||
|
||||
module.exports = input => typeof input === 'string' ? input.replace(ansiRegex(), '') : input;
|
||||
module.exports = string => typeof string === 'string' ? string.replace(ansiRegex(), '') : string;
|
||||
|
||||
+27
-20
@@ -1,32 +1,37 @@
|
||||
{
|
||||
"_args": [
|
||||
[
|
||||
"strip-ansi@4.0.0",
|
||||
"/mnt/Foxconn/Digitalent/Deverloper/liff-push_2series"
|
||||
"strip-ansi@6.0.1",
|
||||
"/home/node/nuxt"
|
||||
]
|
||||
],
|
||||
"_from": "strip-ansi@4.0.0",
|
||||
"_id": "strip-ansi@4.0.0",
|
||||
"_from": "strip-ansi@6.0.1",
|
||||
"_id": "strip-ansi@6.0.1",
|
||||
"_inBundle": false,
|
||||
"_integrity": "sha1-qEeQIusaw2iocTibY1JixQXuNo8=",
|
||||
"_integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==",
|
||||
"_location": "/strip-ansi",
|
||||
"_phantomChildren": {},
|
||||
"_requested": {
|
||||
"type": "version",
|
||||
"registry": true,
|
||||
"raw": "strip-ansi@4.0.0",
|
||||
"raw": "strip-ansi@6.0.1",
|
||||
"name": "strip-ansi",
|
||||
"escapedName": "strip-ansi",
|
||||
"rawSpec": "4.0.0",
|
||||
"rawSpec": "6.0.1",
|
||||
"saveSpec": null,
|
||||
"fetchSpec": "4.0.0"
|
||||
"fetchSpec": "6.0.1"
|
||||
},
|
||||
"_requiredBy": [
|
||||
"/string-width"
|
||||
"/eslint",
|
||||
"/inquirer",
|
||||
"/string-width",
|
||||
"/webpack-hot-middleware",
|
||||
"/webpackbar/wrap-ansi",
|
||||
"/wrap-ansi"
|
||||
],
|
||||
"_resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-4.0.0.tgz",
|
||||
"_spec": "4.0.0",
|
||||
"_where": "/mnt/Foxconn/Digitalent/Deverloper/liff-push_2series",
|
||||
"_resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz",
|
||||
"_spec": "6.0.1",
|
||||
"_where": "/home/node/nuxt",
|
||||
"author": {
|
||||
"name": "Sindre Sorhus",
|
||||
"email": "sindresorhus@gmail.com",
|
||||
@@ -36,18 +41,20 @@
|
||||
"url": "https://github.com/chalk/strip-ansi/issues"
|
||||
},
|
||||
"dependencies": {
|
||||
"ansi-regex": "^3.0.0"
|
||||
"ansi-regex": "^5.0.1"
|
||||
},
|
||||
"description": "Strip ANSI escape codes",
|
||||
"description": "Strip ANSI escape codes from a string",
|
||||
"devDependencies": {
|
||||
"ava": "*",
|
||||
"xo": "*"
|
||||
"ava": "^2.4.0",
|
||||
"tsd": "^0.10.0",
|
||||
"xo": "^0.25.3"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=4"
|
||||
"node": ">=8"
|
||||
},
|
||||
"files": [
|
||||
"index.js"
|
||||
"index.js",
|
||||
"index.d.ts"
|
||||
],
|
||||
"homepage": "https://github.com/chalk/strip-ansi#readme",
|
||||
"keywords": [
|
||||
@@ -81,7 +88,7 @@
|
||||
"url": "git+https://github.com/chalk/strip-ansi.git"
|
||||
},
|
||||
"scripts": {
|
||||
"test": "xo && ava"
|
||||
"test": "xo && ava && tsd"
|
||||
},
|
||||
"version": "4.0.0"
|
||||
"version": "6.0.1"
|
||||
}
|
||||
|
||||
+12
-5
@@ -1,6 +1,6 @@
|
||||
# strip-ansi [](https://travis-ci.org/chalk/strip-ansi)
|
||||
|
||||
> Strip [ANSI escape codes](https://en.wikipedia.org/wiki/ANSI_escape_code)
|
||||
> Strip [ANSI escape codes](https://en.wikipedia.org/wiki/ANSI_escape_code) from a string
|
||||
|
||||
|
||||
## Install
|
||||
@@ -17,12 +17,23 @@ const stripAnsi = require('strip-ansi');
|
||||
|
||||
stripAnsi('\u001B[4mUnicorn\u001B[0m');
|
||||
//=> 'Unicorn'
|
||||
|
||||
stripAnsi('\u001B]8;;https://github.com\u0007Click\u001B]8;;\u0007');
|
||||
//=> 'Click'
|
||||
```
|
||||
|
||||
|
||||
## strip-ansi for enterprise
|
||||
|
||||
Available as part of the Tidelift Subscription.
|
||||
|
||||
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)
|
||||
|
||||
|
||||
## Related
|
||||
|
||||
- [strip-ansi-cli](https://github.com/chalk/strip-ansi-cli) - CLI for this module
|
||||
- [strip-ansi-stream](https://github.com/chalk/strip-ansi-stream) - Streaming version of this module
|
||||
- [has-ansi](https://github.com/chalk/has-ansi) - Check if a string has ANSI escape codes
|
||||
- [ansi-regex](https://github.com/chalk/ansi-regex) - Regular expression for matching ANSI escape codes
|
||||
- [chalk](https://github.com/chalk/chalk) - Terminal string styling done right
|
||||
@@ -33,7 +44,3 @@ stripAnsi('\u001B[4mUnicorn\u001B[0m');
|
||||
- [Sindre Sorhus](https://github.com/sindresorhus)
|
||||
- [Josh Junon](https://github.com/qix-)
|
||||
|
||||
|
||||
## License
|
||||
|
||||
MIT
|
||||
|
||||
Reference in New Issue
Block a user