strip-ansi 0.1.0 → 0.1.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.
- package/cli.js +2 -16
- package/package.json +2 -2
- package/readme.md +1 -1
package/cli.js
CHANGED
|
@@ -4,21 +4,6 @@ var fs = require('fs');
|
|
|
4
4
|
var strip = require('./index');
|
|
5
5
|
var input = process.argv[2];
|
|
6
6
|
|
|
7
|
-
|
|
8
|
-
function getStdin(cb) {
|
|
9
|
-
var ret = '';
|
|
10
|
-
|
|
11
|
-
process.stdin.setEncoding('utf8');
|
|
12
|
-
|
|
13
|
-
process.stdin.on('data', function (data) {
|
|
14
|
-
ret += data;
|
|
15
|
-
});
|
|
16
|
-
|
|
17
|
-
process.stdin.on('end', function () {
|
|
18
|
-
cb(ret);
|
|
19
|
-
});
|
|
20
|
-
}
|
|
21
|
-
|
|
22
7
|
if (process.argv.indexOf('-h') !== -1 || process.argv.indexOf('--help') !== -1) {
|
|
23
8
|
console.log('strip-ansi <input file> > <output file>');
|
|
24
9
|
console.log('or');
|
|
@@ -36,6 +21,7 @@ if (input) {
|
|
|
36
21
|
return;
|
|
37
22
|
}
|
|
38
23
|
|
|
39
|
-
|
|
24
|
+
process.stdin.setEncoding('utf8');
|
|
25
|
+
process.stdin.on('data', function (data) {
|
|
40
26
|
process.stdout.write(strip(data));
|
|
41
27
|
});
|
package/package.json
CHANGED
package/readme.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# strip-ansi [](http://travis-ci.org/sindresorhus/strip-ansi)
|
|
2
2
|
|
|
3
|
-
> Strip ANSI
|
|
3
|
+
> Strip [ANSI escape codes](http://en.wikipedia.org/wiki/ANSI_escape_code#Colors_and_Styles) (used for colorizing strings in the terminal)
|
|
4
4
|
|
|
5
5
|
Used in the terminal color module [chalk](https://github.com/sindresorhus/chalk).
|
|
6
6
|
|