strip-ansi 1.0.0 → 3.0.1

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/license +21 -0
  2. package/package.json +13 -12
  3. package/readme.md +8 -18
  4. package/cli.js +0 -39
package/license ADDED
@@ -0,0 +1,21 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (sindresorhus.com)
4
+
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:
11
+
12
+ The above copyright notice and this permission notice shall be included in
13
+ all copies or substantial portions of the Software.
14
+
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.
package/package.json CHANGED
@@ -1,26 +1,27 @@
1
1
  {
2
2
  "name": "strip-ansi",
3
- "version": "1.0.0",
3
+ "version": "3.0.1",
4
4
  "description": "Strip ANSI escape codes",
5
5
  "license": "MIT",
6
- "bin": {
7
- "strip-ansi": "cli.js"
8
- },
9
- "repository": "sindresorhus/strip-ansi",
6
+ "repository": "chalk/strip-ansi",
10
7
  "author": {
11
8
  "name": "Sindre Sorhus",
12
9
  "email": "sindresorhus@gmail.com",
13
- "url": "http://sindresorhus.com"
10
+ "url": "sindresorhus.com"
14
11
  },
12
+ "maintainers": [
13
+ "Sindre Sorhus <sindresorhus@gmail.com> (sindresorhus.com)",
14
+ "Joshua Boy Nicolai Appelman <joshua@jbna.nl> (jbna.nl)",
15
+ "JD Ballard <i.am.qix@gmail.com> (github.com/qix-)"
16
+ ],
15
17
  "engines": {
16
18
  "node": ">=0.10.0"
17
19
  },
18
20
  "scripts": {
19
- "test": "mocha"
21
+ "test": "xo && ava"
20
22
  },
21
23
  "files": [
22
- "index.js",
23
- "cli.js"
24
+ "index.js"
24
25
  ],
25
26
  "keywords": [
26
27
  "strip",
@@ -33,7 +34,6 @@
33
34
  "colors",
34
35
  "terminal",
35
36
  "console",
36
- "cli",
37
37
  "string",
38
38
  "tty",
39
39
  "escape",
@@ -48,9 +48,10 @@
48
48
  "text"
49
49
  ],
50
50
  "dependencies": {
51
- "ansi-regex": "^0.2.1"
51
+ "ansi-regex": "^2.0.0"
52
52
  },
53
53
  "devDependencies": {
54
- "mocha": "*"
54
+ "ava": "*",
55
+ "xo": "*"
55
56
  }
56
57
  }
package/readme.md CHANGED
@@ -1,11 +1,11 @@
1
- # strip-ansi [![Build Status](https://travis-ci.org/sindresorhus/strip-ansi.svg?branch=master)](https://travis-ci.org/sindresorhus/strip-ansi)
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
3
  > Strip [ANSI escape codes](http://en.wikipedia.org/wiki/ANSI_escape_code)
4
4
 
5
5
 
6
6
  ## Install
7
7
 
8
- ```sh
8
+ ```
9
9
  $ npm install --save strip-ansi
10
10
  ```
11
11
 
@@ -15,27 +15,17 @@ $ npm install --save strip-ansi
15
15
  ```js
16
16
  var stripAnsi = require('strip-ansi');
17
17
 
18
- stripAnsi('\x1b[4mcake\x1b[0m');
18
+ stripAnsi('\u001b[4mcake\u001b[0m');
19
19
  //=> 'cake'
20
20
  ```
21
21
 
22
22
 
23
- ## CLI
24
-
25
- ```sh
26
- $ npm install --global strip-ansi
27
- ```
28
-
29
- ```sh
30
- $ strip-ansi --help
31
-
32
- Usage
33
- $ strip-ansi <input-file> > <output-file>
34
- $ cat <input-file> | strip-ansi > <output-file>
23
+ ## Related
35
24
 
36
- Example
37
- $ strip-ansi unicorn.txt > unicorn-stripped.txt
38
- ```
25
+ - [strip-ansi-cli](https://github.com/chalk/strip-ansi-cli) - CLI for this module
26
+ - [has-ansi](https://github.com/chalk/has-ansi) - Check if a string has ANSI escape codes
27
+ - [ansi-regex](https://github.com/chalk/ansi-regex) - Regular expression for matching ANSI escape codes
28
+ - [chalk](https://github.com/chalk/chalk) - Terminal string styling done right
39
29
 
40
30
 
41
31
  ## License
package/cli.js DELETED
@@ -1,39 +0,0 @@
1
- #!/usr/bin/env node
2
- 'use strict';
3
- var fs = require('fs');
4
- var pkg = require('./package.json');
5
- var strip = require('./');
6
- var input = process.argv[2];
7
-
8
- function help() {
9
- console.log([
10
- pkg.description,
11
- '',
12
- 'Usage',
13
- ' $ strip-ansi <input-file> > <output-file>',
14
- ' $ cat <input-file> | strip-ansi > <output-file>',
15
- '',
16
- 'Example',
17
- ' $ strip-ansi unicorn.txt > unicorn-stripped.txt'
18
- ].join('\n'));
19
- }
20
-
21
- if (process.argv.indexOf('--help') !== -1) {
22
- help();
23
- return;
24
- }
25
-
26
- if (process.argv.indexOf('--version') !== -1) {
27
- console.log(pkg.version);
28
- return;
29
- }
30
-
31
- if (input) {
32
- process.stdout.write(strip(fs.readFileSync(input, 'utf8')));
33
- return;
34
- }
35
-
36
- process.stdin.setEncoding('utf8');
37
- process.stdin.on('data', function (data) {
38
- process.stdout.write(strip(data));
39
- });