Permalink
Browse files

Documentation

  • Loading branch information...
1 parent faed04e commit 01baa7e5f03e23d7c7b626501ea5255be484f494 @medikoo committed Aug 8, 2011
Showing with 29 additions and 0 deletions.
  1. +29 −0 README.md
View
@@ -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();

0 comments on commit 01baa7e

Please sign in to comment.