ircjs

1.1.10 • Public • Published

Table of Contents

ircJS

Extends EventEmitter3

Extendable base class for ircJS classes

Parameters

  • hostname string Hostname to connect to (optional, default 'irc.irc7.com')
  • port number Server port to connect to (optional, default 6667)
  • useTLS boolean? Describes if SSL/TLS encryption should be used (optional, default false)

Meta

client

The client object object contains multiple properties about the connection

Alias: ircJS.c

Type: Object

Properties

  • away boolean Returns the value true or false depending on whether you are marked as away or not.
  • me string Returns your current nickname.
  • port number Returns the port specified in the constructor whether you are connected to the server or not.
  • realName string Returns the connection's 'realname'. in the constructor whether you are connected or not.
  • server string Returns the name of the server to which you are currently connected.
  • serverTarget string Returns the address specified in the constructor whether you are connected to the server or not.
  • ssl boolean Returns true if TLS/SSL was requested
  • userName string Returns your current username

event

The events object contains multiple properties that are useful for dealing with the handling of events.

Alias: ircJS.e

Type: Object

Properties

  • address string Returns the address of the user associated with an event in the form user@host.
  • chann string Returns the name of the channel for a specific event. For all non-channel events chan will be $null.
  • event string Returns the name of the event that was triggered.
  • fulladdress string Returns the full address of the user triggering an event in the form nick!user@host.
  • nick string Returns the nickname of the user associated with an event.
  • numeric string Returns the nickname of the user associated with an event.
  • rawMsg string Returns raw server line for server events.
  • site string Returns the portion of $address after the @ for the user associated with an event in the form user@host.
  • target string Returns the target of an event.

connect

Connect the ircJS to the host specified in construction

Parameters

  • callback Function? An optional callback for when the client has successfully connected.

Returns object Instance of ircJS

parsePrefix

Converts a string representation of an IRC server/user (prefix) into a javascript object.

Parameters

Returns IRCPrefix

send

Used to send an unterminated string to the IRC server.

Parameters

  • data String? Data to be send to server (optional, default '')

Returns object Current instance of ircJS

IRCPrefix

An object containing information extracted from an IRC prefix

Type: Object

Parameters

  • target
  • text

Properties

  • source string The full IRC prefix used to create this object
  • name string The servername/nick of the prefix
  • user string The username/ident of the prefix
  • host string The hostname of the prefix
  • server string The server that the IRCPrefix is connected to

Package Sidebar

Install

npm i ircjs

Weekly Downloads

11

Version

1.1.10

License

GPL-3.0

Last publish

Collaborators

  • jd