0.1.4 • Published 3 months ago

irc-parse-line v0.1.4

Weekly downloads
9
License
MIT
Repository
github
Last release
3 months ago

IRC Message Parser

License: MIT

The simplest possible IRC message parser, with the most extensible suite of tests.

Usage:

const { parseIrcLine } = require('irc-parse-line')
parseIrcLine('@tag1=value1;tag2;vendor1/tag3=value2;vendor2/tag4 COMMAND param1 param2 :param3 param3"')
/* Returns the following:
 *    {
 *      tags: [
 *        [ 'tag1', 'value1' ],
 *        [ 'tag2', '' ],
 *        [ 'vendor1/tag3', 'value2' ],
 *        [ 'vendor2/tag4', '' ]
 *      ],
 *      verb: 'COMMAND',
 *      params: [ 'param1', 'param2', 'param3 param3"' ]
 *    }
 */

The object returned by parseIrcLine(line: string) has the following fields:

field name and typedescription
verb: stringcommand used
servername: stringserver name (when specified)
source: stringsource of the message, often the user nick name
user: stringuser sending the message
host: stringsource host for this message
tags: [string, string][]IRC message tags
params: [string]IRC message parameters, including trailing parameter
0.1.4

3 months ago

0.1.3

3 years ago

0.1.2

3 years ago

0.1.1

3 years ago

0.1.0

3 years ago