irc.colors.js
Easily use colored output and formatting in your irc bots.
Usage
const c = require('irc-colors');
...
ircbot.say('#chan', c.blue('hello everyone'));
ircbot.say('#chan', c.underline.red('WARNING'));
ircbot.say('#chan', c.white.bgblack('inverted'));
warn = c.bold.red.bgyellow;
ircbot.say('#chan', warn('BIGGER WARNING'));
ircbot.say('#chan', c.rainbow('having fun!');
But wait, there's more!
If you don't mind changing the prototype of the String object, then use the global() function.
require('irc-colors').global()
...
ircbot.say('#chan', 'say something'.irc.red());
ircbot.say('#chan', 'hi everyone!'.irc.green.bold());
ircbot.say('#chan', 'etc etc'.irc.underline.grey.bgblack())
Global syntax was inspired by 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
Original name or alternate can be used, without spaces
bot.say('#chat', c.bluecyan('hi'));
Styles
Strip
You can also strip out any colors/style from IRC messages.
stripColors
stripStyle
stripColorsAndStyle
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
npm test