# template-colors

> beautiful color usage within template literals

Latest version **0.0.9** (published 2019-05-25) · MIT license · 0 weekly downloads

## Install

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

## Health

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

Positive: no vulnerabilities.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.9 |
| Published | 2019-05-25 |
| First published | 2016-08-28 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 2 |
| Unpacked size | 20.7 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 24 |
| Author | Chad Scira |
| Maintainers | icodeforlove |

## Links

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

## Dependencies (2)

- [colors](https://npm.io/package/colors.md) ^1.1.2
- [req-once](https://npm.io/package/req-once.md) 0.0.1

## Recent versions

- 0.0.9 (latest) — 2019-05-25
- 0.0.8 — 2018-11-22
- 0.0.7 — 2018-09-20
- 0.0.6 — 2018-09-20
- 0.0.5 — 2018-08-20
- 0.0.4 — 2016-08-29
- 0.0.3 — 2016-08-29
- 0.0.2 — 2016-08-29
- 0.0.1 — 2016-08-28
- 0.0.0 — 2016-08-28

## README

# template-colors [![Build Status](https://travis-ci.org/icodeforlove/template-colors.png?branch=master)](https://travis-ci.org/icodeforlove/template-colors)

### next generation terminal colors!

beautiful color usage within template literals (uses [colors](https://github.com/marak/colors.js) behind the scenes)

## install

```
npm install --save template-colors
```

## usage

you can compose colored template literals in many ways

```javascript
import c from 'template-colors';

console.log(c`found ${17}.bold new users`);

console.log(c`found ${17}.bold new users`.bold.underline.grey);

console.log(c`could not delete ${6}.bold.green users`.underline.red);

console.log(c`user ${'John Doe'}.white.bold ${'logged'}.yellow in at ${new Date()}.white.bold`.grey);

console.log(c`
          This is ${'a'}.blue.italic
          ${'multiline'}.black.magentaBG
          ${'example'}.bold.underline.
`.grey);
```

![screenshot](https://img42.com/nwedl+)

## features

rgb / rgbBG (may be unsupported by your terminal)

```javascript
c`foo bar`.rgb(255,0,0)
c`foo bar`.rgb(255,0,0).rgbBG(0,0,0)
```

inline style commands

```javascript
c`${'foo bar'}.bold.red`
```

pre existing styles

```javascript
c`${'foo bar'.bold}.red`
```

defalt styles to apply to whole string

```javascript
c`${'foo'}.red bar`.grey.underline
```

custom defined styles
```javascript
c.define('error', 'rgb(255,0,0)');
c.define('log', ['rgb(0,0,0)', 'rgbBG(255,255,255)', 'bold', 'underline', 'italic']);

c`foo bar`.error
c`foo bar`.log
```

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