Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

irc-stream

clux44MIT0.3.2

A duplex streaming IRC client built on top of irc

irc, bot, duplex, stream, gu

readme

irc-stream

npm status build status dependency status coverage status

irc-stream is a minimalistic, streaming bot wrapper for the irc module.

irc-stream will relay any combination of the following:

  • channel messages addressed to the client (default on)
  • pms (default off)

These messages are available as a readable stream, and can thus be piped into a writable stream. Messages can be written like for a writable stream, and messages sent will be sent in the channel/pm.

Usage

Ideally, use it with gu as both a readable and writable stream:

var ircStream = require('irc-stream')(ircServer, ircName, ircModuleOpts, ircStreamOpts);
var gu = require('gu')(scriptPath, scriptFiles);

ircStream.pipe(gu).pipe(ircStream);

Where the first three irc-stream arguments are simply passed through to the irc module.

Alternatively you could use it as just a readable stream or a writable stream. See flight-stream for an example as using it as a writable stream only.

Options

The fourth argument control how we listen on IRC. By default the following options are all disabled or zero:

{
  allErrors: Boolean, // manually handle `irc` error events
  ignoreChannel: Boolean, // ignore channel directed messages
  answerPms: Boolean, // respond to private messages
  neverHighlight: Boolean // never highlight channel responses
  alwaysHighlight: Boolean // always highlight channel responses
  participationChance: Number // probability to respond without being addressed
}

NB: Can only do one of neverHighlight and alwaysHighlight. By default, irc-stream will highlight the channel recipient on the first message only.

Installation

$ npm install irc-stream

License

MIT-Licensed. See LICENSE file for details.

changelog

0.3.1 / 2015-11-15

  • Added .npmignore

0.3.1 / 2015-05-08

  • smell module now correctly in dependencies rather than devDependencies

0.3.0 / 2015-04-05

  • Now uses the simpler `gu@0.5.0` stream specification
  • Explicit close(reason, cb) method that closes the irc.Client

0.2.0 / 2015-04-04

  • PMs no longer trigger potentially two readable messages #3
  • Fixed participationChance being wrongly coerced to an integer
  • announcerMode renamed to neverHighlight
  • conversationMode renamed to alwaysHighlight
  • answerPms default is false (although this was the case before - wrong docs)

0.1.0 / 2015-04-03

  • participationChance now a number in the range 0 to 1
  • noChan option renamed to ignoreChannel
  • Module now has tests

0.0.8 / 2014-03-05

  • Channel identification now case insensitive.

0.0.7 / 2014-03-03

  • Added participationChance option (from @john-peterson)

0.0.6 / 2013-09-28

  • Added conversationMode option

0.0.4 / 2013-09-27

  • Added announcerMode to options

0.0.2 / 2013-09-26

  • Document existing options - and pass them through

0.0.1 / 2013-09-13

  • Initial version