Product
Introducing Enhanced Alert Actions and Triage Functionality
Socket now supports four distinct alert actions instead of the previous two, and alert triaging allows users to override the actions taken for all individual alerts.
ansis
Advanced tools
Changelog
3.2.0 (2024-04-24)
ansis.isSupported()
method to detect color supportReadme
Colorize terminal with ANSI colors & styles, smaller and faster alternative to Chalk.
import ansis, { red, green, black, ansi256, hex } from 'ansis';
ansis.cyan('path/to/file')
green('Succeful!')
red`Error!`
black.bgYellow`Warning!`
ansi256(214)`Orange`
hex('#E0115F').bold.underline('Hello TrueColor!')
🚀 Install and Quick Start
📖 Read full docs on GitHub
See the features comparison and benchmarks of most popular terminal colors libraries:
ansis
chalk
kleur
kolorist
colors.js
colorette
picocolors
ansi-colors
cli-color
colors-cli
.
import ansis, { red, green, bold, underline } from 'ansis'
red.bold.underline('text')
red`RED text ${green`GREEN text`} RED text`
dim
bold
italic
underline
strikethrough
red`Error!`
redBright`Error!`
bgRed`Error!`
bgRedBright`Error!`
fg(56)`violet`
bg(208)`orange`
rgb(224, 17, 95)`Ruby`
, hex('#96C')`Amethyst`
open
and close
properties `Hello ${red.open}World${red.close}!`
ansis.strip()
end of line
when used \n
in stringansis.isSupported()
methodNO_COLOR
FORCE_COLOR
--no-color
--color
String.prototype
FAQs
Colorize terminal with ANSI colors & styles
The npm package ansis receives a total of 293,987 weekly downloads. As such, ansis popularity was classified as popular.
We found that ansis demonstrated a healthy version release cadence and project activity because the last version was released less than 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
Socket now supports four distinct alert actions instead of the previous two, and alert triaging allows users to override the actions taken for all individual alerts.
Security News
Polyfill.io has been serving malware for months via its CDN, after the project's open source maintainer sold the service to a company based in China.
Security News
OpenSSF is warning open source maintainers to stay vigilant against reputation farming on GitHub, where users artificially inflate their status by manipulating interactions on closed issues and PRs.