Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Documentation

  • Loading branch information...
commit 01baa7e5f03e23d7c7b626501ea5255be484f494 1 parent faed04e
@medikoo authored
Showing with 29 additions and 0 deletions.
  1. +29 −0 README.md
View
29 README.md
@@ -68,3 +68,32 @@ Styles will display correctly if font used in your console supports them.
* bgMagenta
* bgCyan
* 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();
Please sign in to comment.
Something went wrong with that request. Please try again.