# irc-colors

> Color and formatting for irc made easy.

Latest version **1.5.0** (published 2018-11-15) · MIT license · 0 weekly downloads

## Install

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

## Health

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

Positive: no vulnerabilities.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.5.0 |
| Published | 2018-11-15 |
| First published | 2011-07-24 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >=6 |
| Dependencies | 0 |
| Unpacked size | 8.4 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 36 |
| Author | fent |
| Maintainers | fent |
| Keywords | irc, color, colour |

## Links

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

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

- 1.5.0 (latest) — 2018-11-15
- 1.4.3 — 2018-07-22
- 1.4.2 — 2018-02-26
- 1.4.1 — 2017-11-24
- 1.4.0 — 2017-10-29
- 1.3.3 — 2017-03-27
- 1.3.2 — 2017-03-02
- 1.3.1 — 2016-11-30
- 1.3.0 — 2016-07-16
- 1.2.1 — 2016-03-16
- 1.2.0 — 2015-06-14
- 1.1.1 — 2015-06-02
- 1.1.0 — 2014-04-13
- 1.0.3 — 2012-10-11
- 1.0.2 — 2012-01-13
- … 2 more at https://npm.io/package/irc-colors/versions

## README

# irc.colors.js

Easily use colored output and formatting in your irc bots.

[![Build Status](https://secure.travis-ci.org/fent/irc-colors.js.svg)](http://travis-ci.org/fent/irc-colors.js)
[![Dependency Status](https://david-dm.org/fent/irc-colors.js.svg)](https://david-dm.org/fent/irc-colors.js)
[![codecov](https://codecov.io/gh/fent/irc-colors.js/branch/master/graph/badge.svg)](https://codecov.io/gh/fent/irc-colors.js)



# Usage

```javascript
const c = require('irc-colors');
...
ircbot.say('#chan', c.blue('hello everyone')); // prints blue text
ircbot.say('#chan', c.underline.red('WARNING')); // can be chained
ircbot.say('#chan', c.white.bgblack('inverted')); // white text with black background

warn = c.bold.red.bgyellow;
ircbot.say('#chan', warn('BIGGER WARNING')); // bold red text with yellow background
ircbot.say('#chan', c.rainbow('having fun!'); // prints rainbow colored text
```

### But wait, there's more!

If you don't mind changing the prototype of the String object, then use the global() function.

```javascript
require('irc-colors').global()
...
ircbot.say('#chan', 'say something'.irc.red()); // prints red text
ircbot.say('#chan', 'hi everyone!'.irc.green.bold()); // prints green bold text
ircbot.say('#chan', 'etc etc'.irc.underline.grey.bgblack()) // chains work too
```

Global syntax was inspired by [colors.js](https://github.com/marak/colors.js) and because of that, there's possibility that you might want to use that module along with this one. That's why the *irc* property of a String needs to be called first to use the formatting functions.


## Colors

![colors](img/colors.png)

Original name or alternate can be used, without spaces

    bot.say('#chat', c.bluecyan('hi'));


## Styles

![styles](img/styles.png)


## Extras

![extras](img/extras.png)

## Strip

You can also strip out any colors/style from IRC messages.

* `stripColors`
* `stripStyle`
* `stripColorsAndStyle`

```js
const c = require('irc-colors');

ircbot.on('message', (from, message) => {
  console.log(c.stripColorsAndStyle(message));
});
```


# Install

    npm install irc-colors


# Tests
Tests are written with [vows](http://vowsjs.org/)

```bash
npm test
```

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