Skip to content

Commit 0978944

Browse files
committed
Require Node.js 4
1 parent 8270705 commit 0978944

File tree

8 files changed

+77
-93
lines changed

8 files changed

+77
-93
lines changed

.editorconfig

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,6 @@ charset = utf-8
77
trim_trailing_whitespace = true
88
insert_final_newline = true
99

10-
[{package.json,*.yml}]
10+
[*.yml]
1111
indent_style = space
1212
indent_size = 2
13-
14-
[*.md]
15-
trim_trailing_whitespace = false

.gitattributes

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
11
* text=auto
2+
*.js text eol=lf

.travis.yml

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
1-
sudo: false
21
language: node_js
32
node_js:
4-
- 'iojs'
5-
- '0.12'
6-
- '0.10'
3+
- '8'
4+
- '6'
5+
- '4'

index.js

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
11
'use strict';
2-
var ansiRegex = require('ansi-regex')();
2+
const ansiRegex = require('ansi-regex');
33

4-
module.exports = function (str) {
5-
return typeof str === 'string' ? str.replace(ansiRegex, '') : str;
6-
};
4+
module.exports = input => typeof input === 'string' ? input.replace(ansiRegex(), '') : input;

license

Lines changed: 4 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,9 @@
1-
The MIT License (MIT)
1+
MIT License
22

33
Copyright (c) Sindre Sorhus <[email protected]> (sindresorhus.com)
44

5-
Permission is hereby granted, free of charge, to any person obtaining a copy
6-
of this software and associated documentation files (the "Software"), to deal
7-
in the Software without restriction, including without limitation the rights
8-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9-
copies of the Software, and to permit persons to whom the Software is
10-
furnished to do so, subject to the following conditions:
5+
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
116

12-
The above copyright notice and this permission notice shall be included in
13-
all copies or substantial portions of the Software.
7+
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
148

15-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21-
THE SOFTWARE.
9+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

package.json

Lines changed: 50 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -1,57 +1,52 @@
11
{
2-
"name": "strip-ansi",
3-
"version": "3.0.1",
4-
"description": "Strip ANSI escape codes",
5-
"license": "MIT",
6-
"repository": "chalk/strip-ansi",
7-
"author": {
8-
"name": "Sindre Sorhus",
9-
"email": "[email protected]",
10-
"url": "sindresorhus.com"
11-
},
12-
"maintainers": [
13-
"Sindre Sorhus <[email protected]> (sindresorhus.com)",
14-
"Joshua Boy Nicolai Appelman <[email protected]> (jbna.nl)",
15-
"JD Ballard <[email protected]> (github.com/qix-)"
16-
],
17-
"engines": {
18-
"node": ">=0.10.0"
19-
},
20-
"scripts": {
21-
"test": "xo && ava"
22-
},
23-
"files": [
24-
"index.js"
25-
],
26-
"keywords": [
27-
"strip",
28-
"trim",
29-
"remove",
30-
"ansi",
31-
"styles",
32-
"color",
33-
"colour",
34-
"colors",
35-
"terminal",
36-
"console",
37-
"string",
38-
"tty",
39-
"escape",
40-
"formatting",
41-
"rgb",
42-
"256",
43-
"shell",
44-
"xterm",
45-
"log",
46-
"logging",
47-
"command-line",
48-
"text"
49-
],
50-
"dependencies": {
51-
"ansi-regex": "^2.0.0"
52-
},
53-
"devDependencies": {
54-
"ava": "*",
55-
"xo": "*"
56-
}
2+
"name": "strip-ansi",
3+
"version": "3.0.1",
4+
"description": "Strip ANSI escape codes",
5+
"license": "MIT",
6+
"repository": "chalk/strip-ansi",
7+
"author": {
8+
"name": "Sindre Sorhus",
9+
"email": "[email protected]",
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": "^2.0.0"
47+
},
48+
"devDependencies": {
49+
"ava": "*",
50+
"xo": "*"
51+
}
5752
}

readme.md

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,22 @@
11
# strip-ansi [![Build Status](https://travis-ci.org/chalk/strip-ansi.svg?branch=master)](https://travis-ci.org/chalk/strip-ansi)
22

3-
> Strip [ANSI escape codes](http://en.wikipedia.org/wiki/ANSI_escape_code)
3+
> Strip [ANSI escape codes](https://en.wikipedia.org/wiki/ANSI_escape_code)
44
55

66
## Install
77

88
```
9-
$ npm install --save strip-ansi
9+
$ npm install strip-ansi
1010
```
1111

1212

1313
## Usage
1414

1515
```js
16-
var stripAnsi = require('strip-ansi');
16+
const stripAnsi = require('strip-ansi');
1717

18-
stripAnsi('\u001b[4mcake\u001b[0m');
19-
//=> 'cake'
18+
stripAnsi('\u001B[4mUnicorn\u001B[0m');
19+
//=> 'Unicorn'
2020
```
2121

2222

@@ -28,6 +28,12 @@ stripAnsi('\u001b[4mcake\u001b[0m');
2828
- [chalk](https://github.com/chalk/chalk) - Terminal string styling done right
2929

3030

31+
## Maintainers
32+
33+
- [Sindre Sorhus](https://github.com/sindresorhus)
34+
- [Josh Junon](https://github.com/qix-)
35+
36+
3137
## License
3238

33-
MIT © [Sindre Sorhus](http://sindresorhus.com)
39+
MIT

test.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
import test from 'ava';
2-
import fn from './';
2+
import m from '.';
33

44
test('strip color from string', t => {
5-
t.is(fn('\u001b[0m\u001b[4m\u001b[42m\u001b[31mfoo\u001b[39m\u001b[49m\u001b[24mfoo\u001b[0m'), 'foofoo');
5+
t.is(m('\u001B[0m\u001B[4m\u001B[42m\u001B[31mfoo\u001B[39m\u001B[49m\u001B[24mfoo\u001B[0m'), 'foofoo');
66
});
77

88
test('strip color from ls command', t => {
9-
t.is(fn('\u001b[00;38;5;244m\u001b[m\u001b[00;38;5;33mfoo\u001b[0m'), 'foo');
9+
t.is(m('\u001B[00;38;5;244m\u001B[m\u001B[00;38;5;33mfoo\u001B[0m'), 'foo');
1010
});
1111
test('strip reset;setfg;setbg;italics;strike;underline sequence from string', t => {
12-
t.is(fn('\x1b[0;33;49;3;9;4mbar\x1b[0m'), 'bar');
12+
t.is(m('\u001B[0;33;49;3;9;4mbar\u001B[0m'), 'bar');
1313
});

0 commit comments

Comments
 (0)