Skip to content

Instantly share code, notes, and snippets.

@AccaliaDeElementia
Created December 14, 2015 20:45
Show Gist options
  • Save AccaliaDeElementia/5fff3b2be1932c502f18 to your computer and use it in GitHub Desktop.
Save AccaliaDeElementia/5fff3b2be1932c502f18 to your computer and use it in GitHub Desktop.
'use strict';
const fs = require('fs');
const util = require('../util');
let client;
function reader() {
fs.createReadStream(exports.config.pipe)
.on('data', (data) => {
client.say(exports.config.channel, data);
})
.on('end', () => {
reader();
});
}
exports.begin = function (_client) {
client = _client;
reader();
};
exports.stop = function () {
util.log('Pipes Stopping');
};
exports.defaults = {
channel: '#thedailywtf',
pipe: './fifo'
};
exports.config = {};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment