2.1.1 • Published 6 years ago

ircmessageparser v2.1.1

Weekly downloads
1
License
ISC
Repository
github
Last release
6 years ago

irc message parser

Greenkeeper badge Build Status codecov.io npm license

extracts styling information, urls and channels from a string.

how to install

npm install ircmessageparser --save

api

const parser = require('ircmessageparser');

parse(text, settings)

this will extract the styling, urls, and channels

  • text
  • settings
    • stripControlCodes strip control chars (0x00-0x1F)
    • channelPrefixes should be an array with RPL_ISUPPORT.CHANTYPES (ex. ['#', '&']) defaults to ['#']
    • userModes userModes should be an array with RPL_ISUPPORT.PREFIX (ex: ['!', '+']) defaults to ['@', '+']
const parsed = parser.parse('\x034#Test');
console.log(parsed);
/*
output: [{
    channel: '#Test',
    start: 0,
    end: 5,
    fragments: [{
        bold: false,
        textColor: 4,
        bgColor: undefined,
        reverse: false,
        italic: false,
        underline: false,
        text: '#Test',
        start: 0,
        end: 5,
     }]
}]
*/

notes

if you prefer a different algorithm for link / channel detection take a look at lib/parse

2.1.1

6 years ago

2.1.0

7 years ago

2.0.4

7 years ago

2.0.3

7 years ago

2.0.2

7 years ago

2.0.1

7 years ago

2.0.0

7 years ago

1.1.2

8 years ago

1.1.1

8 years ago

1.0.0

8 years ago