2.4.0 • Published 2 years ago

tekko v2.4.0

Weekly downloads
867
License
MIT
Repository
github
Last release
2 years ago

Tekko

Another IRC message parser and formatter.

Heavily inspired by irc-message, this parser also includes a built-in tag value unescaper according to IRCv3 Specifications.

Table of Contents

Installation

npm install tekko --save

Usage

Parse

const { parse } = require("tekko");

const result = parse("@lorem=ipsum;dolor :hello!sir@madam PRIVMSG #test :Hello, world!"));
/* { command: 'PRIVMSG',
 *   params: [ '#test', 'Hello, world!' ],
 *   prefix:
 *    { host: 'madam',
 *      nick: 'hello',
 *      user: 'sir' },
 *   tags: {
 *      lorem: 'ipsum',
 *      dolor: true } }
 */

console.log(result.middle);
/* [ '#test' ]
 */

console.log(result.trailing);
/* 'Hello, world!'
 */

Format

const { format } = require("tekko");

const result = format({
  command: "PRIVMSG",
  params: ["#test", "Hello, world!"],
  prefix: {
    host: "madam",
    nick: "hello",
    user: "sir",
  },
  tags: {
    lorem: 'ipsum',
    dolor: true,
  },
});
/* "@lorem=ipsum;dolor :hello!sir@madam PRIVMSG #test :Hello, world!"
 */

Author

Alexandre Breteau - @0xSeldszar

License

MIT © Alexandre Breteau

2.4.0

2 years ago

2.3.0

3 years ago

2.2.0

3 years ago

2.1.0

3 years ago

2.0.2

3 years ago

2.0.1

3 years ago

2.0.0

3 years ago

1.0.0

3 years ago