node package manager


IRC protocol library.


IRC protocol library for Node.js. Used to be part of ircc.

$ npm install ircp

Node.js 0.8.x or above.

Takes an IRC message as raw text and returns a message object. A few examples (via the node REPL):

> ircp.parse(':nick!user@host PART #channel');

{ command: 'PART',
  parameters: [ '#channel' ],
  nick: 'nick',
  user: 'user',
  host: 'host',
  type: 'command' }

> ircp.parse(' 001 botname :Welcome to the example IRC network!');

{ command: 'WELCOME',
   [ 'botname',
     'Welcome to the example IRC network!' ],
  server: '',
  code: '001',
  type: 'reply' }

Throws an Error if the message can't be parsed.

The reverse of parser. Takes a message object and turns it into a string.

> ircp.serialize(ircp.parse(':nick!user@host PART #channel'));

':nick!user@host PART #channel'

Throws an Error if the object is not a valid message.

Find the name and type of an IRC command. Known numeric commands are converted to their human-readable form. A few examples:


{ name: 'WELCOME', type: 'reply' }


{ name: 'NOSUCHNICK', type: 'error' }


{ name: 'NOTICE', type: 'command' }

Possible values for type are 'reply', 'error', 'command' and 'unknown'.