
Product
Introducing Webhook Events for Alert Changes
Add real-time Socket webhook events to your workflows to automatically receive software supply chain alert changes in real time.
An elegant lib that converts the chalked (ANSI) text to HTML.
$ npm install ansi-html
var ansiHTML = require('ansi-html');
var str = ansiHTML('[ANSI_TEXT]');
e.g.:
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.
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'
});
ansiHTML.reset();
var openTags = ansiHTML.tags.open;
var closeTags = ansiHTML.tags.close;
$ npm install -l
$ npm test
Chalk is a popular npm package that allows you to style terminal text with chainable ANSI escape codes. Unlike ansi-html, which is focused on converting ANSI codes to HTML, Chalk is used to create styled terminal text directly in Node.js applications.
ansi-to-html is another npm package that converts ANSI escape codes into HTML. It provides a similar functionality to ansi-html but offers more customization options, such as setting up different color themes and handling newlines.
Colors is an npm package that adds color support to strings in the terminal. It is similar to ansi-html in that it deals with ANSI codes for colorizing text, but it does not convert them to HTML. Instead, it enhances strings to display colored output in the terminal.
FAQs
An elegant lib that converts the chalked (ANSI) text to HTML.
The npm package ansi-html receives a total of 5,104,240 weekly downloads. As such, ansi-html popularity was classified as popular.
We found that ansi-html demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Product
Add real-time Socket webhook events to your workflows to automatically receive software supply chain alert changes in real time.

Security News
ENISA has become a CVE Program Root, giving the EU a central authority for coordinating vulnerability reporting, disclosure, and cross-border response.

Product
Socket now scans OpenVSX extensions, giving teams early detection of risky behaviors, hidden capabilities, and supply chain threats in developer tools.