# color-cc

> Get colors in your node.js console, support commonjs / typescript / esnext, simplified version of colors

Latest version **0.1.0** (published 2026-01-04) · MIT license · 0 weekly downloads

## Install

```sh
npm install color-cc
pnpm add color-cc
yarn add color-cc
bun add color-cc
```

## Health

**Score 55/100 (C)** — status: stable.

Positive: has types; no vulnerabilities; high quality score.

Warnings: low downloads; no esm support; pre 1.0.

## Facts

| | |
|---|---|
| Version | 0.1.0 |
| Published | 2026-01-04 |
| First published | 2023-10-27 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Node | >=10.0 |
| Dependencies | 0 |
| Unpacked size | 17.1 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1 |
| Author | Froguard |
| Maintainers | froguard |
| Keywords | ansi, terminal, colors, console |

## Links

- npm: https://www.npmjs.com/package/color-cc
- Repository: https://github.com/Froguard/color-cc
- Homepage: https://github.com/Froguard/color-cc#readme
- Issues: https://github.com/Froguard/color-cc/issues
- npm.io page: https://npm.io/package/color-cc

## Alternatives

- [localforage](https://npm.io/package/localforage.md) — 6.2M weekly downloads
- [localforage-observable](https://npm.io/package/localforage-observable.md) — 30.8K weekly downloads
- [@y/y](https://npm.io/package/@y/y.md) — 30.1K weekly downloads
- [@metaobjectsdev/render](https://npm.io/package/@metaobjectsdev/render.md) — 3.5K weekly downloads
- [@ledgerhq/coin-algorand](https://npm.io/package/@ledgerhq/coin-algorand.md) — 1.1K weekly downloads

## Recent versions

- 0.1.0 (latest) — 2026-01-04
- 0.0.8 — 2025-10-19
- 0.0.7 — 2024-07-12
- 0.0.6 — 2024-06-25
- 0.0.5 — 2024-04-05
- 0.0.4 — 2024-04-05
- 0.0.3 — 2023-10-28
- 0.0.2 — 2023-10-27
- 0.0.1 — 2023-10-27

## README

# color-cc

> Get colors in your node.js console, Similar to [colors](https://www.npmjs.com/package/colors), but a simplified version of it

> Just work in Node.js

> Support js / ts / es

## install

```sh
npm i -S color-cc
# yarn add color-cc
```

## usage

### 1.commonjs

```js
const ColorCC = require('color-cc').default;
// const { ColorCC } = require('color-cc');

console.log(ColorCC.green('hello'));
console.log(ColorCC.red.underline('i like cake and pies'));

console.log(ColorCC.success('I have finished my work!'));
console.log(ColorCC.fail('It is not be done!'));
console.warn(ColorCC.warn('warning something...'));
console.error(ColorCC.error('It occurs errors!'));
```

> don't forget the `.default` !!!

### 2.typescript/esnext

```ts
import ColorCC from 'color-cc';
// com
console.log('');
console.log(ColorCC.error('error text...'));
console.log(ColorCC.warn('warning text...'));
console.log(ColorCC.warning('warning text...'));
console.log(ColorCC.success('success text...'));
console.log(ColorCC.fail('fail text...'));

// F,  F.B,  F.S,  F.B.S
console.log('');
console.log(ColorCC.red('red'));
console.log(ColorCC.red.bgYellow('red.bgYellow'));
console.log(ColorCC.red.strike('red.strike'));
console.log(ColorCC.red.bgYellow.strike('red.bgYellow.strike'));

// B,  B.S
console.log('');
console.log(ColorCC.bgYellow('bgYellow'));
console.log(ColorCC.bgYellow.strike('bgYellow.strike'));

// S
console.log('');
console.log(ColorCC.bold('bold'));
console.log(ColorCC.underline('underline'));
console.log(ColorCC.blink('blink'));
console.log(ColorCC.strike('strike'));
```


## API

> Similar to colors, but a simplified version of colors

> function like: `(...args:[]) => string` 

#### fore,back,style

- ColorCC.${foreName}
  - eg: `ColorCC.red('abcdefg')`
- ColorCC.${foreName}.${backName}
  - eg: `ColorCC.red.bgYellow('abcdefg')`
- ColorCC.${foreName}.${backName}.${styleName}
  - eg: `ColorCC.red.bgYellow.bold('abcdefg')`
- ColorCC.${foreName}.${styleName}
  - eg: `ColorCC.red.bold('abcdefg')`
- ColorCC.${backName}
  - eg: `ColorCC.bgYellow('abcdefg')`
- ColorCC.${backName}.${styleName}
  - eg: `ColorCC.bgYellow.bold('abcdefg')`
- ColorCC.${styleName}
  - eg: `ColorCC.bold('abcdefg')`

##### ansi prop name

```ts
// foreNames
type ForeCodePropName = "black" | "red" | "green" | "yellow" | "blue" | "magenta" | "cyan" | "white" | "gray" | "grey" | "brightBlack" | "brightRed" | "brightGreen" | "brightYellow" | "brightBlue" | "brightMagenta" | "brightCyan" | "brightWhite";
// backNames
type BackCodePropName = "bgBlack" | "bgRed" | "bgGreen" | "bgYellow" | "bgBlue" | "bgMagenta" | "bgCyan" | "bgWhite" | "bgGray" | "bgGrey" | "bgBrightBlack" | "bgBrightRed" | "bgBrightGreen" | "bgBrightYellow" | "bgBrightBlue" | "bgBrightMagenta" | "bgBrightCyan" | "bgBrightWhite";
// styleNames
type StyleCodePropName = "bold" | "underline" | "blink" | "strike";
```

#### Common combinations

- ColorCC.warn
- ColorCC.error
- ColorCC.success
- ColorCC.fail


#### custom

- ColorCC.colorify(text: string, options?: Partial<ColorifyOptions>)

---
_Source: https://npm.io/package/color-cc · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
