edgeport - v1.0.6
    Preparing search index...

    Function connect

    • Connects to an IRC server, registers, and returns a live session.

      Dials the core transport (implicit TLS when tls: 'implicit', otherwise plaintext), sends PASS if given, runs the IRCv3 CAP + SASL exchange when sasl is set, then registers with NICK + USER and waits for 001 (RPL_WELCOME). A 433 (nick in use) or other fatal registration numeric rejects with AuthError. A background pump then answers PINGs and routes messages/events.

      Parameters

      Returns Promise<IrcSession>

      The live session.

      If credentials are rejected or the nick is unavailable.

      If the connection cannot be established.

      If the server speaks the protocol incorrectly.

      If the handshake exceeds the deadline.

      1.0.4

      import { connect } from 'edgeport/irc';

      await using irc = await connect({ hostname: 'irc.example.com', nick: 'edgebot' });
      await irc.join('#edgeport');
      await irc.say('#edgeport', 'hello from the edge');
      for await (const m of irc.messages()) {
      if (m.isChannel) console.log(`<${m.from}> ${m.text}`);
      break;
      }