3.1.1 • Published 4 months ago

@ctrl/irc v3.1.1

Weekly downloads
1
License
MIT
Repository
github
Last release
4 months ago

@ctrl/irc npm

A typed IRC client library for node

Based on irc-upd. Includes irc color decoding based on irc-colors.js

Install

npm install @ctrl/irc

Use

import { IrcClient } from '@ctrl/irc';
const client = new IrcClient('irc.yourserver.com', 'myNick', {
  channels: [],
  port: 7000,
  secure: true,
});
client.connect();

Join a channel

client.join('#yourchannel yourpass');

Leave a channel

client.part('#yourchannel');

Send a message

// To channel
client.say('#yourchannel', 'hello');
// To user
client.say('nonbeliever', 'sup');

With typescript 4.1 template strings feature events can be fully typed.

// (from, message) parameters are typed via template strings matching `message#${string}`
client.addListener('message#yourchannel', (from, message) => {
  console.log(from + ' => #yourchannel: ' + message);
});

Debugging - subscribe to the raw messages and see what events are being parsed and re-emitted

client.on('raw', message => {
  console.log(message);
});

Links

3.1.1

4 months ago

3.1.0

4 months ago

3.0.1

7 months ago

3.0.0

9 months ago

2.1.1

12 months ago

2.1.0

2 years ago

2.0.1

2 years ago

2.0.0

2 years ago

1.1.4

3 years ago

1.1.3

3 years ago

1.1.2

3 years ago

1.1.1

3 years ago

1.1.0

3 years ago

1.0.4

3 years ago

1.0.3

3 years ago

1.0.2

3 years ago

1.0.1

3 years ago