PNG  IHDR;IDATxܻn0K )(pA 7LeG{ §㻢|ذaÆ 6lذaÆ 6lذaÆ 6lom$^yذag5bÆ 6lذaÆ 6lذa{ 6lذaÆ `}HFkm,mӪôô! x|'ܢ˟;E:9&ᶒ}{v]n&6 h_tڠ͵-ҫZ;Z$.Pkž)!o>}leQfJTu іچ\X=8Rن4`Vwl>nG^is"ms$ui?wbs[m6K4O.4%/bC%t Mז -lG6mrz2s%9s@-k9=)kB5\+͂Zsٲ Rn~GRC wIcIn7jJhۛNCS|j08yiHKֶۛkɈ+;SzL/F*\Ԕ#"5m2[S=gnaPeғL lذaÆ 6l^ḵaÆ 6lذaÆ 6lذa; _ذaÆ 6lذaÆ 6lذaÆ RIENDB` ansi-html [![NPM version](https://badge.fury.io/js/ansi-html-community.svg)](http://badge.fury.io/js/ansi-html) [![Build Status](https://app.travis-ci.com/mahdyar/ansi-html-community.svg?branch=master)](https://app.travis-ci.com/mahdyar/ansi-html-community) ========= An elegant lib that converts the chalked (ANSI) text to HTML. # Coverage - All styles of [chalk](https://github.com/sindresorhus/chalk) (100%) and [colors](https://github.com/Marak/colors.js). - There are over **150** randomized test cases under `test`. # Installation ``` $ npm install ansi-html-community ``` # Usage ```javascript var ansiHTML = require('ansi-html-community'); var str = ansiHTML('[ANSI_TEXT]'); ``` e.g.: ```javascript var chalk = require('chalk'); var str = chalk.bold.red('foo') + ' bar'; console.log('[ANSI]', str) console.log('[HTML]', ansiHTML(str)); ``` See complete examples under `test` / `examples` directory. # Set Colors ```javascript ansiHTML.setColors({ reset: ['555', '666'], // FOREGROUND-COLOR or [FOREGROUND-COLOR] or [, BACKGROUND-COLOR] or [FOREGROUND-COLOR, BACKGROUND-COLOR] black: 'aaa', // String red: 'bbb', green: 'ccc', yellow: 'ddd', blue: 'eee', magenta: 'fff', cyan: '999', lightgrey: '888', darkgrey: '777' }); ``` # Reset ```javascript ansiHTML.reset(); ``` # Exposed Tags ```javascript var openTags = ansiHTML.tags.open; var closeTags = ansiHTML.tags.close; ``` # Test ``` $ npm install -l $ npm test ```