Home > irc-client.js

irc-client.js

Irc-client.js is a project mainly written in ..., it's free.

irc-client.js

An IRC Client in Javascript.

Why?

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.

Contributing

  • Fork the project.
  • Make your feature addition or bug fix.
  • Add tests for it. This is important so I don't break it in a future version unintentionally.
  • Make sure all the tests pass.
  • Commit and push your changes.
  • Send me a pull request. Bonus points for topic branches.

Testing

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.

Authors

Craig R Webster http://barkingiguana.com/#me

Links

[1] http://commonjs.org/ [2] http://github.com/craigw/spectacular.git

Previous:undo-tree