Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

irc

Package Overview
Dependencies
Maintainers
1
Versions
21
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

irc

An IRC client library for node

  • 0.3.4
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
909
decreased by-38.75%
Maintainers
1
Weekly downloads
 
Created
Source

node-irc_ is an IRC client library written in JavaScript_ for Node_.

.. _node-irc: http://node-irc.readthedocs.org/ .. _JavaScript: http://en.wikipedia.org/wiki/JavaScript .. _Node: http://nodejs.org/

You can access more detailed documentation for this module at Read the Docs_

Installation

The easiest way to get it is via npm_::

npm install irc

If you want to run the latest version (i.e. later than the version available via npm_) you can clone this repo, then use npm_ to link-install it::

npm link /path/to/your/clone

Of course, you can just clone this, and manually point at the library itself, but I really recommend using npm_!

Basic Usage

This library provides basic IRC client functionality. In the simplest case you can connect to an IRC server like so::

var irc = require('irc');
var client = new irc.Client('irc.dollyfish.net.nz', 'myNick', {
channels: ['#blah'],
});

Of course it's not much use once it's connected if that's all you have!

The client emits a large number of events that correlate to things you'd normally see in your favourite IRC client. Most likely the first one you'll want to use is::

client.addListener('message', function (from, to, message) {
console.log(from + ' => ' + to + ': ' + message);
});

or if you're only interested in messages to the bot itself::

client.addListener('pm', function (from, message) {
console.log(from + ' => ME: ' + message);
});

or to a particular channel::

client.addListener('message#yourchannel', function (from, message) {
console.log(from + ' => #yourchannel: ' + message);
});

At the moment there are functions for joining::

client.join('#yourchannel yourpass');

parting::

client.part('#yourchannel');

talking::

client.say('#yourchannel', "I'm a bot!");
client.say('nonbeliever', "SRSLY, I AM!");

and many others. Check out the API documentation for a complete reference.

For any commands that there aren't methods for you can use the send() method which sends raw messages to the server::

client.send('MODE', '#yourchannel', '+o', 'yournick');

Further documentation (including a complete API reference) are available in reStructuredText format in the docs/ folder of this project, or online at Read the Docs_.

If you find any issues with the documentation (or the module) please send a pull request or file an issue and I'll do my best to accommodate.

.. _npm: http://github.com/isaacs/npm .. _here: http://node-irc.readthedocs.org/en/latest/API.html .. _Read the Docs: http://readthedocs.org/docs/node-irc/en/latest/

FAQs

Package last updated on 14 Apr 2012

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc