# colorize

> An expressive interface for ANSI colored strings and terminal output.

Latest version **0.1.0** (published 2011-04-01) · 0 weekly downloads

## Install

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

## 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.1.0 |
| Published | 2011-04-01 |
| First published | 2011-04-01 |
| Weekly downloads | 0 |
| TypeScript types | none |
| Module format | CommonJS |
| Node | * |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 39 |
| Author | Matt Patenaude |
| Keywords | color, ansi, terminal |

## Links

- npm: https://www.npmjs.com/package/colorize
- Repository: https://github.com/mattpat/colorize
- npm.io page: https://npm.io/package/colorize

## 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.1.0 (latest) — 2011-04-01

## README

Colorize
========
Colorize is an expressive interface for ANSI colored strings and terminal output. There are already a decent handful of string-coloring modules out there, but colorize is different in the way it works.

Most modules will have you use some kind of a colorizing function to return a string with the proper ANSI codes prepended. Colorize, on the other hand, lets you express the colorization inline (it's essentially a set of aliases for the original ANSI codes, plus a stack to allow nesting). So, if you wanted to color a word red, you would do something like:

	This word is #red[red].

You can also nest colorizations:

	#bold[Welcome to the #green[Green Machine] tool!]

Currently colorize supports the standard set of 8 ANSI colors (black, red, green, yellow, blue, magenta, cyan, white), along with bold, italic, underline, blink, and a special "reset" keyword.

Usage
-----
To use colorize, install it somewhere local and use:

	var colorize = require('./colorize');

Or install it using [npm](http://npmjs.org) and use:

	var colorize = require('colorize');

You then use `.ansify` to get a colorized string:

	var myStr = colorize.ansify('This word is #blue[blue].');

Alternatively, you can use colorize's alias to the console to output strings directly:

	var cconsole = colorize.console;
	cconsole.log('A world of #magenta[pretty colors]!');

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