Registry / messaging / tekko
library3.0.1jsnpmunverified

Another IRC message parser and formatter, version 3.0.1, stable and actively maintained. Heavily inspired by irc-message, it includes built-in tag value unescaping according to IRCv3 specifications. It provides both parsing and formatting of IRC messages with support for message tags, prefixes, commands, and parameters. The API is simple and focused, making it a lightweight alternative to more comprehensive IRC libraries.

npm install tekko
INSTALL
IMPORT
SIG · TEKKO
T
tekko
messagingjavascriptv3.0.1
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

parse
import { parse } from 'tekko'
const parse = require('tekko').parse
ESM import is recommended; CJS require works but may have issues with newer Node.js versions.
format
import { format } from 'tekko'
Named export for formatting IRC messages.
Message
import type { Message } from 'tekko'
import { Message } from 'tekko'
Message is a TypeScript type, not a runtime value; use type import to avoid runtime error.

Demonstrates parsing an IRC message string and formatting it back, including tags and prefix handling.

import { parse, format } from 'tekko'; const raw = '@tag=value;empty :nick!user@host PRIVMSG #channel :Hello world'; const parsed = parse(raw); console.log(parsed.tags); // { tag: 'value', empty: true } console.log(parsed.prefix); // { nick: 'nick', user: 'user', host: 'host' } console.log(parsed.command); // 'PRIVMSG' console.log(parsed.params); // ['#channel', 'Hello world'] const formatted = format(parsed); console.log(formatted === raw); // true
Debug
Known issues
gotchaThe prefix object always includes 'host' property, which may be an empty string for messages without host.
fix
Always check if prefix.host exists or treat empty string as missing host.
affects: >=0.0.0
breakingv3 changed the output structure: prefix now returns an object with nick, user, host instead of a string.
fix
Use prefix.nick, prefix.user, prefix.host instead of parsing a string.
affects: >=3.0.0 <3.0.0
deprecatedThe 'tags' property returns an object where missing values are set to 'true' (boolean). This may break code expecting string values.
fix
Check for value === true to detect tag without value, e.g., if (tagValue === true) { /* no value */ }
affects: >=0.0.0
Errors
Common errors & fixes
Cannot find module 'tekko' or its corresponding type declarations.
Package is not installed or TypeScript cannot infer types.
fix
Run `npm install tekko` and ensure tsconfig.json includes 'node_modules' or use `@types/tekko` if available.
'parse' is not exported from 'tekko'
Using CommonJS require incorrectly or importing from wrong path.
fix
Use `import { parse } from 'tekko'` or `const { parse } = require('tekko')`.
Property 'host' does not exist on type '{ nick: string; user: string; host?: string | undefined; }'
TypeScript strict mode expects host to be optional.
fix
Access prefix.host with optional chaining: prefix.host?.length or check for undefined.
Upgrade
Version history
3.0.1latest on npm
Audit
Dependencies

No dependency data recorded yet.

Agent activity
20 hits · last 30 days
node
18
Amazon
1
OpenAI (training)
1
Resources
packagetekko
tekko — npm install tekko · libregistry