# tekko

> Another IRC message parser and formatter

Latest version **3.0.1** (published 2022-11-16) · MIT license · 0 weekly downloads

## Install

```sh
npm install tekko
pnpm add tekko
yarn add tekko
bun add tekko
```

## Health

**Score 25/100 (F)** — status: abandoned.

Positive: has types; no vulnerabilities; high quality score.

Warnings: low downloads; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 3.0.1 |
| Published | 2022-11-16 |
| First published | 2018-12-13 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 19 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 4 |
| Author | Alexandre Breteau |
| Maintainers | seldszar |
| Keywords | formatter, irc, message, parser |

## Links

- npm: https://www.npmjs.com/package/tekko
- Repository: https://github.com/seldszar/tekko
- Homepage: https://github.com/seldszar/tekko#readme
- Issues: https://github.com/seldszar/tekko/issues
- npm.io page: https://npm.io/package/tekko

## Alternatives

- [babylon](https://npm.io/package/babylon.md) — 5.1M weekly downloads
- [csscolorparser](https://npm.io/package/csscolorparser.md) — 3.7M weekly downloads
- [expr-eval-fork](https://npm.io/package/expr-eval-fork.md) — 1.5M weekly downloads
- [@leeoniya/ufuzzy](https://npm.io/package/@leeoniya/ufuzzy.md) — 247.7K weekly downloads
- [xml-parser](https://npm.io/package/xml-parser.md) — 78.4K weekly downloads

## Recent versions

- 3.0.1 (latest) — 2022-11-16
- 3.0.0 — 2022-11-16
- 2.4.0 — 2019-09-29
- 2.3.0 — 2019-07-08
- 2.2.0 — 2019-07-07
- 2.1.0 — 2019-07-06
- 2.0.2 — 2019-07-03
- 2.0.1 — 2019-07-03
- 2.0.0 — 2019-07-02
- 1.0.0 — 2018-12-13

## README

# Tekko

> Another IRC message parser and formatter.

Heavily inspired by [`irc-message`](https://github.com/sigkell/irc-message), this parser also includes a built-in tag value unescaper according to [IRCv3 Specifications](https://ircv3.net/specs/core/message-tags-3.2.html).

## Table of Contents

- [Installation](#installation)
- [Usage](#usage)
- [Author](#author)
- [License](#license)

## Installation

```bash
npm install tekko --save
```

## Usage

### Parse

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

```javascript
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](https://twitter.com/0xSeldszar)

## License

MIT © [Alexandre Breteau](https://seldszar.fr)

---
_Source: https://npm.io/package/tekko · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
