云盘
志元云盘
备份云盘
Home
/
志元云盘
/
webdav
/
sync
/
c
/
vue-modbus
/
modbus-project
/
node_modules
/
ansi-html-community
File
OriginalPic
Thumbnails
CopyAllDownloadUrl
EditTime
Size
bin
2024-08-12 11:51:32
1.99 KB
index.js
2024-07-14 16:18:58
4.16 KB
LICENSE
2024-07-14 16:18:58
11.06 KB
package.json
2024-07-14 16:18:58
1 KB
README.md
2024-07-14 16:18:58
1.42 KB
ansi-html [](http://badge.fury.io/js/ansi-html) [](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 ```
2025-08-29 19:58:15 Friday 216.73.216.167 Runningtime:0.013s Mem:1.48 MB