NodeJS lib to connect and interact with Quassel IRC server
MIT License
Javascript library to connect and interact with Quassel IRC server.
npm install --production libquassel
You just need to import dist/libquassel.js
in your HTML page.
npm install libquassel
In order to create a browser compatible file, run the following commands
# use browserify to build on change
npm run watch
# before commit, make the dev version + minified version + the doc
npm run build
Version 3.0
introduces the following breaking changes:
message.Type
has been superseded by message.Types
, and all its constants are now UPPERCASEchannel.active
has been superseded by channel.isActive
channel.isChannel()
has been superseded by channel.isChannel
channel.isHighlighted()
has been superseded by channel.isHighlighted
message.isHighlighted()
has been superseded by message.isHighlighted
message.isSelf()
has been superseded by message.isSelf
network.getBufferCollection()
and network.getBufferMap()
have been merged into networks.buffers
networkCollection.findBuffer(...)
and networkCollection.get(...)
have been merged into network.getBuffer(...)
network.setName(name)
as been superseded by network.name = name
network.getStatusBuffer()
as been superseded by network.statusBuffer
Client(...).connect
method expects a Socket
or any other Duplex
as parameter.libquassel
is available as a global object.Client(...).connect
method expects a libquassel.WebSocketStream
or any other Duplex
as parameter.const { Client } = require('libquassel');
const net = require('net');
const socket = net.createConnection({
host: "localhost",
port: 4242
});
const quassel = new Client((next) => next("user", "password"));
quassel.on('network.init', (networkId) => {
network = quassel.networks.get(networkId);
// ...
});
// ...
quassel.connect(socket);
<!-- In your HTML -->
<script src="/path/to/libquassel.js"></script>
// libquassel in available as a global in browser
const socket = new libquassel.WebSocketStream('wss://domain.tld:12345', ['binary', 'base64']);
const quassel = new libquassel.Client((next) => next("user", "password"));
quassel.on('network.init', (networkId) => {
network = quassel.networks.get(networkId);
// ...
});
// ...
quassel.connect(socket);
See test folder for examples.
Copyright (c) 2019 Joël Charles Licensed under the MIT license.