
Research
SANDWORM_MODE: Shai-Hulud-Style npm Worm Hijacks CI Workflows and Poisons AI Toolchains
An emerging npm supply chain attack that infects repos, steals CI secrets, and targets developer AI toolchains for further compromise.
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 2,661,770 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.

Research
An emerging npm supply chain attack that infects repos, steals CI secrets, and targets developer AI toolchains for further compromise.

Company News
Socket is proud to join the OpenJS Foundation as a Silver Member, deepening our commitment to the long-term health and security of the JavaScript ecosystem.

Security News
npm now links to Socket's security analysis on every package page. Here's what you'll find when you click through.