yoil - yet (an)other irc library
yoil is a simple, yet fairly flexible IRC library written in JavaScript. It is intended for web-based IRC communication, and therefore only provides a WebSocket transport.
Features:
- Adaptive requesting of IRCv3 capabilities: some IRCv3 caps require other caps to actually be useful (I'm looking at you echo-message). Therefore, yoil checks if a capabilities dependants are present before requesting.
- SASL mechanisms: Since PLAIN is so easy to implement, I decided to implement SCRAM-SHA-256 and SCRAM-SHA-512 support (oh, and SCRAM-SHA-1, but don't use that)
- Namespaced events: Events are provided in namespaces depending on where the event belongs. The most interesting thing this does, is provide a way to distinguish between private messages and channel messages, using user::privmsg and channel::privmsg respectively.
- And a lot more, like auto reconnecting, automatically changing your nick if its in use, and a few other features.
IRCv3 support:
Feature | Support |
---|---|
CAP | ✔️ |
CAP 302 | ✔️ |
cap-notify | ✔️ |
account-notify | ✔️ |
account-tag | ✔️ |
away-notify | ✔️ |
batch | ✔️ |
chghost | ✔️ |
echo-message | ✔️ |
extended-join | ✔️ |
invite-notify | ✔️ |
message-tags | ✔️ |
monitor | ❌ |
msgid | ✔️ |
multi-prefix | ✔️ |
sasl v3.1 | ✔️ |
sasl v3.2 | ✔️ |
server-time | ✔️ |
sts | ❌ |
userhost-in-names | ✔️ |
webirc | ❌ |
Example:
Here is a simple example:
const irc = ; const config = nickname: 'nickname' username: 'username' realname: 'realname' port: 7002 host: '127.0.0.1' tls: true saslUsername: 'username' saslPassword: 'password' autoReconnect: true; const client = config; client; client; client; client;