Skip to content

Latest commit

 

History

History
74 lines (53 loc) · 1.49 KB

README.md

File metadata and controls

74 lines (53 loc) · 1.49 KB

nwitch-base64

Build Status Dependency Status

nwitch (and slate-irc) plugin for base64 encoding and decoding.

05:34 <KenanY> !base64 encode Hello World
05:34 <nwitch> KenanY: SGVsbG8gV29ybGQ=
05:35 <KenanY> !base64 decode SGVsbG8gV29ybGQ=
05:35 <nwitch> KenanY: Hello World

Example

As a nwitch plugin (using config.toml):

[plugins]
nwitch-base64 = true

Or through nwitch's API:

var Nwitch = require('nwitch');
var nwitchBase64 = require('nwitch-base64');

var nwitch = new Nwitch({
  irc: {
    address: 'irc.freenode.org',
    port: 6667
  }
});

nwitch.use(nwitchBase64());

Technically, all nwitch plugins are just slate-irc plugins, so you could also use this as a slate-irc plugin:

var net = require('net');
var irc = require('slate-irc');
var nwitchBase64 = require('nwitch-base64');

var stream = net.connect({
  port: 6667,
  host: 'irc.freenode.org'
});

var client = irc(stream);
client.use(nwitchBase64());

Installation

$ npm install nwitch-base64

API

var nwitchBase64 = require('nwitch-base64');

nwitchBase64()

Returns a function that accepts an instance of slate-irc.