Socket
Socket
Sign inDemoInstall

irc-colors

Package Overview
Dependencies
Maintainers
1
Versions
17
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

irc-colors - npm Package Compare versions

Comparing version 1.0.3 to 1.1.0

13

lib/irc-colors.js

@@ -24,3 +24,3 @@ var Hash = require('hashish');

var styles = {
'\x00': 'normal',
'\x0F': 'normal',
'\x1F': 'underline',

@@ -85,3 +85,14 @@ '\x02': 'bold',

exports.stripColors = function(str) {
return str.replace(/(\x03\d{0,2}(,\d{0,2})?)/g, '');
};
exports.stripStyle = function(str) {
return str.replace(/[\x0F\x02\x16\x1F]/g, '');
};
exports.stripColorsAndStyle = function(str) {
return exports.stripColors(exports.stripStyle(str));
};
// adds all functions to each other so they can be chained

@@ -88,0 +99,0 @@ var addGetters = function(f1, name) {

2

package.json

@@ -9,3 +9,3 @@ {

],
"version": "1.0.3",
"version": "1.1.0",
"repository": {

@@ -12,0 +12,0 @@ "type": "git",

@@ -53,3 +53,19 @@ # irc.colors.js [![Build Status](https://secure.travis-ci.org/fent/irc-colors.js.png)](http://travis-ci.org/fent/irc-colors.js)

## Strip
You can also strip out any colors/style from IRC messages.
* `stripColors`
* `stripStyle`
* `stripColorsAndStyle`
```js
var c = require('irc-colors');
ircbot.on('message', function(from, message) {
console.log(c.stripColorsAndStyle(message));
});
```
# Install

@@ -56,0 +72,0 @@

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

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

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc