Comparing version 0.1.1 to 0.1.2
{ | ||
"name": "cli-color", | ||
"version": "0.1.1", | ||
"description": "Colors and formatting for the console", | ||
"version": "0.1.2", | ||
"description": "Colors, formatting and other tools for the console", | ||
"keywords": ["ansi", "color", "console", "terminal", "cli", "shell", "log", "logging", "xterm"], | ||
@@ -20,4 +20,7 @@ "author": "Mariusz Nowak <medikoo+cli-color@medikoo.com> (http://www.medikoo.com/)", | ||
"dependencies": { | ||
"es5-ext": "0.5.x" | ||
"es5-ext": "0.6.x" | ||
}, | ||
"devDependencies": { | ||
"clock": "0.1.x" | ||
} | ||
} |
@@ -1,4 +0,4 @@ | ||
# cli-color - Yet another console color package. | ||
# cli-color - Yet another colors and formatting for the console solution | ||
Colors and formatting for the console. This package won't mess with built-ins and provides neat way to predefine color patterns, see below. | ||
Colors, formatting and other goodies for the console. This package won't mess with built-ins and provides neat way to predefine formatting patterns, see below. | ||
@@ -40,3 +40,3 @@ ## Installation | ||
### Styles | ||
#### Styles | ||
@@ -51,3 +51,3 @@ Styles will display correctly if font used in your console supports them. | ||
### Foreground colors | ||
#### Foreground colors | ||
@@ -63,3 +63,3 @@ * black | ||
### Background colors | ||
#### Background colors | ||
@@ -74,1 +74,30 @@ * bgBlack | ||
* bgWhite | ||
### Additional functions: | ||
#### trim(formatedText) | ||
Trims ANSI formatted string to plain text | ||
var ansiTrim = require('cli-color/lib/trim'); | ||
var plain = ansiTrim(formatted); | ||
#### throbber(interval[, format]) | ||
Displays throbber on given interval. | ||
Interval should be [clock.interval](https://github.com/medikoo/clock) object | ||
Optionally throbber output can be formatted with given format | ||
var interval = require('clock/lib/interval') | ||
, ansiThrobber = require('cli-color/lib/throbber'); | ||
var i = interval(200, true); | ||
// Display throbber while interval is ticking | ||
ansiThrobber(i); | ||
// at any time you can stop/start interval | ||
// When interval is stopped throbber doesn't show | ||
i.stop(); |
@@ -5,18 +5,9 @@ 'use strict'; | ||
module.exports = { | ||
"Plain": function (t, a) { | ||
a.equal(t("test"), "test"); | ||
}, | ||
"Foreground": function (t, a) { | ||
a.equal(t.red(msg), '\x1b[31m' + msg + '\x1b[39m'); | ||
}, | ||
"Background": function (t, a) { | ||
a.equal(t.bgRed(msg), '\x1b[41m' + msg + '\x1b[49m'); | ||
}, | ||
"Format": function (t, a) { | ||
a.equal(t.bold(msg), '\x1b[1m' + msg + '\x1b[22m'); | ||
}, | ||
"Foreground & Format": function (t, a) { | ||
a.equal(t.bold.blue(msg), '\x1b[34m\x1b[1m' + msg + '\x1b[22m\x1b[39m'); | ||
} | ||
module.exports = function (t, a) { | ||
a(t("test"), "test", "Plain"); | ||
a(t.red(msg), '\x1b[31m' + msg + '\x1b[39m', "Foreground"); | ||
a(t.bgRed(msg), '\x1b[41m' + msg + '\x1b[49m', "Background"); | ||
a(t.bold(msg), '\x1b[1m' + msg + '\x1b[22m', "Format"); | ||
a(t.bold.blue(msg), '\x1b[34m\x1b[1m' + msg + '\x1b[22m\x1b[39m', | ||
"Foreground & Format"); | ||
}; |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
Shell access
Supply chain riskThis module accesses the system shell. Accessing the system shell increases the risk of executing arbitrary code.
Found 1 instance in 1 package
13
202
100
7763
1
2
+ Addedes5-ext@0.6.3(transitive)
- Removedes5-ext@0.5.1(transitive)
Updatedes5-ext@0.6.x