Socket
Socket
Sign inDemoInstall

kleur

Package Overview
Dependencies
Maintainers
1
Versions
21
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

kleur - npm Package Compare versions

Comparing version 1.0.1 to 1.0.2

demo.js

6

package.json
{
"name": "kleur",
"version": "1.0.1",
"version": "1.0.2",
"repository": "lukeed/kleur",

@@ -8,3 +8,4 @@ "description": "The fastest Node.js library for formatting terminal text with ANSI colors~!",

"files": [
"*.js"
"*.js",
"*.d.ts"
],

@@ -30,2 +31,3 @@ "author": {

],
"types": "kleur.d.ts",
"devDependencies": {

@@ -32,0 +34,0 @@ "tap-spec": "^5.0.0",

@@ -126,3 +126,3 @@ <div align="center">

// or use a library to detect support
kleur.enabled = require('color-support').stdout;
kleur.enabled = require('color-support').level;

@@ -137,3 +137,3 @@ console.log(kleur.red('I will only be colored red if the terminal supports colors'));

The methods below are grouped by type for legbility purposes only. They each can be [chained](#chained-methods) or [nested](#nested-methods) with one another.
The methods below are grouped by type for legibility purposes only. They each can be [chained](#chained-methods) or [nested](#nested-methods) with one another.

@@ -190,6 +190,8 @@ ***Colors:***

This project (inadvertently) is very similar to [Brian Woodward](https://github.com/doowb)'s awesome [`ansi-colors`](https://github.com/doowb/ansi-colors) project. My original implementation involved writing into a global state &mdash; first by writing into an output string, and then by saving the `keys` array into the `$` directly. Both approaches were leaky & allowed for accidental chains/overwrites. In turn, I borrowed `ansi-colors`'s approach in writing `keys` state into each chain directly.
This project is based on [Brian Woodward](https://github.com/doowb)'s awesome [`ansi-colors`](https://github.com/doowb/ansi-colors) project. My original implementation involved writing into a global state &mdash; first by writing into an output string, and then by saving the `keys` array into the `$` directly. Both approaches were leaky & allowed for accidental chains/overwrites. In turn, I borrowed `ansi-colors`'s approach in writing `keys` state into each chain directly.
Aside from the performance boost, `kleur` exists as a separate module because I've no need for bright color variants nor the symbols. And since those are defining features of `ansi-colors`, they're not something that can be removed.
Aside from the performance boost, `kleur` exists as a separate module because I've removed some of `ansi-colors`'s defining features, like bright color variants and symbols. It's tailor-made for my needs and experimentation.
> You'll probably want to use [`ansi-colors`](https://github.com/doowb/ansi-colors), especially if you need any of those features! [You'll be in good company!](https://www.npmjs.com/browse/depended/ansi-colors)
The benchmark suite is also imported directly from `ansi-colors` :raised_hands:

@@ -196,0 +198,0 @@

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