lib/base/string.js
function style(str, options) {
    var ret = str;
    if (options) {
        if (ret instanceof Array) {
            ret = ret.map(function (s) {
                return style(s, options);
            });
        } else if (options instanceof Array) {
            options.forEach(function (option) {
                ret = style(ret, option);
            });
        } else if (options in styles) {
            ret = '\x1B[' + styles[options] + 'm' + str + '\x1B[0m';
        }
    }
    return ret;
}
function style(str, options) {
    var ret = str;
    if (options) {
        if (ret instanceof Array) {
            ret = ret.map(function (s) {
                return style(s, options);
            });
        } else if (options instanceof Array) {
            options.forEach(function (option) {
                ret = style(ret, option);
            });
        } else if (options in styles) {
            ret = '\x1B[' + styles[options] + 'm' + str + '\x1B[0m';
        }
    }
    return ret;
}
function style ( str , options ) { var ret = str ; if ( options ) { if ( ret instanceof Array ) { ret = ret . map ( function ( s ) { return style ( s , options ) ; } ) ; } else if ( options instanceof Array ) { options . forEach ( function ( option ) { ret = style ( ret , option ) ; } ) ; } else if ( options in styles ) { ret = '\x1B[' + styles [ options ] + 'm' + str + '\x1B[0m' ; } } return ret ; }
Styles a string according to the specified styles.

@example
//style a string red
comb.string.style('myStr', 'red');
//style a string red and bold
comb.string.style('myStr', ['red', bold]);

@param {String} str The string to style.
@param {String|Array} styles the style or styles to apply to a string.
options include :
<ul>
<li>bold</li>
<li>bright</li>
<li>italic</li>
<li>underline</li>
<li>inverse</li>
<li>crossedOut</li>
<li>blink</li>
<li>red</li>
<li>green</li>
<li>yellow</li>
<li>blue</li>
<li>magenta</li>
<li>cyan</li>
<li>white</li>
<li>redBackground</li>
<li>greenBackground</li>
<li>yellowBackground</li>
<li>blueBackground</li>
<li>magentaBackground</li>
<li>cyanBackground</li>
<li>whiteBackground</li>
<li>grey</li>
<li>black</li>

</ul>
@memberOf comb.string
@static
Styles a string according to the specified styles .