medikoo / cli-color

Colors and formatting for the console
ISC License
676 stars 34 forks source link

feature: clear colors from string #15

Closed xpepermint closed 10 years ago

xpepermint commented 10 years ago

Any way to remove all colors from a string? Maybe like this.

var clc = require('cli-color');
clc.clear(clc.cyan('my string')) // output: 'my string'
medikoo commented 10 years ago

@xpepermint there is cli-color/trim:

var clc = require('cli-color');
var clcTrim = require('cli-color/trim');

clcTrim(clc.cyan('my string')) // output: 'my string'
xpepermint commented 10 years ago

e great... thx @medikoo