ircng
v0.0.23
Published
Yet another javascript IRC library
Downloads
9
Readme
ircng
ircng is a javascript library for parsing IRC messages
There are zillions of IRC libraries for javascript, but none that do quite what I wanted, so I wrote one (isn't that what all good developers do?).
You are resposible for making the connection to the IRC server and feeding the parser data. Later it wlil do connections for you but I don't need this functionality at this time.
Very much still a Work In Progess.
Usage:
var stream = new IRCStream();
stream.register({
nickname: 'cryogen',
username: 'user',
realname: 'Real Name'
});
stream.on('message', function(message) {
// Do stuff with irc messages
// message.source - who sent the message
// message.args
});
stream.on('privmsg', function(message) {
// message.source.nick, message.source.user, message.source.host
// message.message
// handle private messages
});
stream.on('numeric', function(message) {
// handle numerics (they also raise individual messages eg on('001')
// message.args
});
stream.on('quit', function(message) {
// message.message - quit message
});
stream.on('nick', function(message) {
// message.newnick
// someone changed nickname
})
stream.joinChannel('test'); // join #test
stream.leaveChannel('test'); // leave/part #test
stream.sendMessage('#test', 'testing'); // send a privmsg to channel or nickname
stream.quit(message); // sends a QUIT command
stream.push('SOME IRC DATA');