Socket
Socket
Sign inDemoInstall

cli-color

Package Overview
Dependencies
Maintainers
1
Versions
26
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

cli-color - npm Package Compare versions

Comparing version 0.1.1 to 0.1.2

lib/throbber.js

9

package.json
{
"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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc