irc-client.js
文件大小: unknow
源码售价: 5 个金币 积分规则     积分充值
资源说明:An IRC client for node.js
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 

Links
-----

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

本源码包内暂不包含可直接显示的源代码文件,请下载源码包。