# colorize-template

> Tagged template literal for ANSI colors.

Latest version **1.0.0** (published 2021-10-07) · MIT license · 0 weekly downloads

## Install

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

## Health

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

Positive: has types; no vulnerabilities.

Warnings: low downloads; no esm support.

Negative: abandoned.

## Facts

| | |
|---|---|
| Version | 1.0.0 |
| Published | 2021-10-07 |
| First published | 2021-10-07 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 4.8 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 15 |
| Author | Usman Yunusov |
| Maintainers | usmanyunusov |
| Keywords | colors, console, formatting, terminal, nanocolors, picocolors, colorette, kleur, colors.js, chalk |

## Links

- npm: https://www.npmjs.com/package/colorize-template
- Repository: https://github.com/usmanyunusov/colorize-template
- Homepage: https://github.com/usmanyunusov/colorize-template#readme
- Issues: https://github.com/usmanyunusov/colorize-template/issues
- npm.io page: https://npm.io/package/colorize-template

## 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

- 1.0.0 (latest) — 2021-10-07

## README

# Colorize Template

Tagged template literal for ANSI colors.

- **No dependencies.**
- Node.js v6+ & browsers support. Support both CJS and ESM projects.
- TypeScript type declarations included.

> You need to provides an object which includes a variety of text coloring and formatting functions. You can use ready-made projects: [Picocolors](https://github.com/alexeyraspopov/picocolors), [Colorette](https://github.com/jorgebucaran/colorette), [Kleur](https://github.com/lukeed/kleur), [Colors.js](https://github.com/Marak/colors.js), [Chalk](https://github.com/chalk/chalk)

```js
import { createColorize } from 'colorize-template'
import * as picocolors from 'picocolors'
import * as colorette from 'colorette'

let colorize = createColorize({
  ...picocolors,
  success: picocolors.green,
  error: colorette.red
})

console.log(
  colorize`Is red {red color} text`,
  colorize`Run {yellow.bgRed ${'yellow'} test}`,
  colorize`Is red {error error and success {success green text}}`,
)
```

> Blocks are delimited by an opening curly brace `{`, a style, some content, and a closing curly brace `}`.

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