Socket
Socket
Sign inDemoInstall

irc-colors

Package Overview
Dependencies
0
Maintainers
1
Versions
17
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    irc-colors

Color and formatting for irc made easy.


Version published
Weekly downloads
861
increased by104.03%
Maintainers
1
Install size
9.29 kB
Created
Weekly downloads
 

Readme

Source

irc.colors.js

Easily use colored output and formatting in your irc bots.

Build Status Dependency Status codecov

Usage

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.

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

Original name or alternate can be used, without spaces

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

Styles

styles

Extras

extras

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

Keywords

FAQs

Last updated on 15 Nov 2018

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc