Irc-client.js is a project mainly written in ..., it's free.
An IRC Client in Javascript.
Javascript is starting to break out of it's perceived roll as a browser-based client-side-only language. I've been playing with node.js for the past few weeks and it's rather nice.
It's always fun to write IRC bots so I'll use this as a way of learning more about Node and Javascript.
irc/client.js will be implemented as a CommonJS[1] module. You'll use it something like this:
var IRC = require("/path/to/irc/client.js"), sys = require("sys"); var client = new IRC.Client(); client.host("irc.freenode.net"); client.nick("NodeJsIrcBot"); client.onConnect(function() { client.join("#node.js"); }); client.onMessage(function(channel, user, message)) { sys.puts(channel + " <" + user + "> " + message); }); client.run();
Also exposed will be hooks for onJoin, onPart and onDisconnect.
It's all rather simplistic at the moment, but it'll slowly develop. If there's something that it doesn't do that you want it to, please feel free to fork and patch.
We use my fork of spectacular[2] for testing. It's setup as a submodule
so you'll get it by running git submodule init && git submodule update
in the project directory.
Run the tests like this:
cd /path/to/irc.js node vendor/spec/tacular.js
All tests must pass for a change to be committed to the master branch.
Craig R Webster http://barkingiguana.com/#me
[1] http://commonjs.org/ [2] http://github.com/craigw/spectacular.git