# termcolor

> console.color

Latest version **0.2.0** (published 2012-02-22) · 0 weekly downloads

## Install

```sh
npm install termcolor
pnpm add termcolor
yarn add termcolor
bun add termcolor
```

## Health

**Score 10/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; low quality score; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.2.0 |
| Published | 2012-02-22 |
| First published | 2011-10-17 |
| Weekly downloads | 0 |
| TypeScript types | none |
| Module format | CommonJS |
| Node | * |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 3 |
| Author | SHIN Suzuki |
| Maintainers | shinout |
| Keywords | color, console |

## Links

- npm: https://www.npmjs.com/package/termcolor
- Repository: https://github.com/shinout/termcolor
- Issues: https://github.com/shinout/termcolor/issues
- npm.io page: https://npm.io/package/termcolor

## Alternatives

- [postcss-color-hex-alpha](https://npm.io/package/postcss-color-hex-alpha.md) — 6.4M weekly downloads
- [randomcolor](https://npm.io/package/randomcolor.md) — 348.0K weekly downloads
- [bows](https://npm.io/package/bows.md) — 1.3K weekly downloads
- [ep_prefer_color_scheme](https://npm.io/package/ep_prefer_color_scheme.md) — 260 weekly downloads
- [coc-yank](https://npm.io/package/coc-yank.md) — 61 weekly downloads

## Recent versions

- 0.2.0 (latest) — 2012-02-22
- 0.1.3 — 2011-11-14
- 0.1.1 — 2011-10-17
- 0.1.0 — 2011-10-17

## README

termcolor
==========
[Node.js] console.log, console.error with colors

### Installation ###
    git clone git://github.com/shinout/termcolor.git

    OR

    npm install termcolor

### Usage ###
#### require ####
    var tc = require("termcolor").define();
    // remember to call define(), which defines methods under "console" object.

    // var tc = require("termcolor").define;
    // this is the same as define(), as termcolor internally use Object.defineProperty's getter/setter.

#### the simplest usage ####
    console.green("this is green"); // displays "this is green" with green color to STDOUT
    console.cyan({hoge: "foobar"}, "multi args? N.P.");


#### check which colors we can use ####
    console.log(tc.colors);
    /* 
        ['black',
        'red',
        'green',
        'yellow',
        'blue',
        'purple',
        'cyan',
        'white']
     */

#### display to STDERR ####
    console.eblue("blue color, to stderr");
    console.eyellow(["yellow color", "to stderr"], "of course, any value is acceptable");


#### get colored string ####
    var redstr    = tc.red("red string");
    var purplestr = tc.purple("purple string");
    console.log(redstr, purplestr);


#### bold ####
    console.bold("hoge")
    console.bold("green", "BOLD GREEN")
    console.purpleB("with B")
    console.eyellowB("e [color] B")


#### pass a color name as the first argument ####
    console.color("green", "text with green color");
    console.ecolor("red", "text with red color", "to stderr");

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