Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

ansis

Package Overview
Dependencies
Maintainers
0
Versions
45
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ansis - npm Package Compare versions

Comparing version 3.2.1 to 3.3.0

21

package.json
{
"name": "ansis",
"version": "3.2.1",
"description": "Colorize terminal with ANSI colors & styles",
"version": "3.3.0",
"description": "Colorize terminal output with ANSI colors & styles",
"keywords": [

@@ -9,3 +9,3 @@ "ansi",

"truecolor",
"ansi256",
"console",
"terminal",

@@ -17,5 +17,3 @@ "cli",

"author": "webdiscus",
"homepage": "https://github.com/webdiscus/ansis",
"repository": "webdiscus/ansis",
"sideEffects": false,
"main": "./index.js",

@@ -28,9 +26,5 @@ "types": "./index.d.ts",

"import": "./index.mjs"
},
"./colors": {
"types": "./index.d.ts",
"require": "./index.js",
"import": "./index.mjs"
}
},
"sideEffects": false,
"engines": {

@@ -40,9 +34,4 @@ "node": ">=15"

"files": [
"index.d.ts",
"index.js",
"index.mjs",
"package.json",
"LICENSE",
"README.md"
"index.*"
]
}
<p align="center">
<a href="https://github.com/webdiscus/ansis">
<img width="323" src="https://github.com/webdiscus/ansis/raw/master/docs/img/ansis-logo.png" alt="ansis"><br>
<img width="323" src="https://github.com/webdiscus/ansis/raw/master/docs/img/ansis-logo.png"><br>
ANSI Styling

@@ -17,2 +17,6 @@ </a>

✅ [Compare features](https://github.com/webdiscus/ansis#compare) with similar packages
📊 [Benchmarks](https://github.com/webdiscus/ansis#benchmark)
📖 [Read full docs on GitHub](https://github.com/webdiscus/ansis)

@@ -25,22 +29,16 @@

ansis.cyan('path/to/file')
green('Succeful!')
red`Error!`
black.bgYellow`Warning!`
ansis.cyan('file')
green('Ok')
red`Error`
black.bgYellow`Warning`
ansi256(214)`Orange`
hex('#E0115F').bold.underline('TrueColor')
hex('#E0115F').bold('TrueColor')
```
## 🏆 Compare & Benchmark
## Highlights
See the [features comparison](https://github.com/webdiscus/ansis#compare) and [benchmarks](https://github.com/webdiscus/ansis#benchmark) of most popular terminal colors libraries:\
`ansis` `chalk` `kleur` `kolorist` `colors.js` `colorette` `picocolors` `ansi-colors` `cli-color` `colors-cli`.
## 💡 Highlights
![ANSI demo](https://github.com/webdiscus/ansis/raw/master/docs/img/ansis-demo.png)
- Supports ESM, CommonJS, TypeScript, Bun, Deno, Next.JS
- [Standard API](https://github.com/webdiscus/ansis#base-colors), drop-in replacement for Chalk
- Default and named import: `import ansis, { red, bold, hex } from 'ansis'`
- Supports ESM, CJS, TypeScript, Bun, Deno, Next.JS
- Named import: `import ansis, { red, bold, hex } from 'ansis'`
- Chained syntax: `red.bold.underline('text')`

@@ -53,3 +51,3 @@ - Nested template strings: ``` red`RED ${green`GREEN`} RED` ```

- Color fallback: TrueColor → 256 colors → 16 colors → no colors
- Raw ANSI codes: ``` `foo ${red.open}red{red.close} bar` ```
- Raw ANSI codes: ``` `foo ${red.open}bar{red.close} foo` ```
- Strip ANSI codes: `ansis.strip()`

@@ -60,2 +58,2 @@ - Detect color support: `ansis.isSupported()`

- Doesn't extend `String.prototype`
- Zero dependencies
- No dependencies
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc