Curious to see if/how well this works with Deno, which I've been using far more lately for shell scripting environments, given it tends to be more easily portable.
Deno has native support for ANSI color output in console.:
https://deno.land/std@0.156.0/fmt/colors.ts
---
import { red } from "https://deno.land/std@0.156.0/fmt/colors.ts";
console.log(red("Hello world!"));
---
Sorry, but `ansis` not work under Deno.
ANSIS is the new Node.js library for formatting text in terminal with ANSI colors & styles.
Why yet one lib?
- up to x3.5 faster than chalk
- dist code is 3 KB only
- supports both ESM and CommonJS
- named import of colors
- chained syntax: ansis.red.bold('text')
- nested template strings: red`A ${cyan`B`} A`
- ANSI 256 colors and Truecolor (RGB, HEX)
- CLI variables NO_COLOR FORCE_COLOR and flags --no-color --color
- strip ANSI codes
- TypeScript friendly
- zero issues
See please the comparison and benchmarks of most popular libraries:
- colors.js
- colorette
- picocolors
- cli-color
- colors-cli
- ansi-colors
- kleur
- chalk
- ansis
Comparison:
https://github.com/webdiscus/ansis#comparison-of-most-popular-libraries
Benchmark:
https://github.com/webdiscus/ansis#benchmark