<commit_before>var reemit = require("re-emitter/reemit")

var publish = require("./publish")
var subscribe = require("./subscribe")

module.exports = duplex

function duplex(client, channel, options) {
    var read = subscribe(client, channel, options)
    var write = publish(client, channel)

    read.write = write.write
    read.end = write.end

    reemit(write, read, ["error", "drain", "finish", "pipe"])

    return read
}<commit_msg>support legacy readable / writable properties for 0.8 Stream.prototype.pipe<commit_after>var reemit = require("re-emitter/reemit")

var publish = require("./publish")
var subscribe = require("./subscribe")

module.exports = duplex

function duplex(client, channel, options) {
    var read = subscribe(client, channel, options)
    var write = publish(client, channel)

    read.write = write.write
    read.end = write.end
    read.writable = true
    read.readable = true

    reemit(write, read, ["error", "drain", "finish", "pipe"])

    return read
}
{'fraction_non_alphanumeric': 0.13654618473895583, 'fraction_numerical': 0.002008032128514056, 'mean_word_length': 3.9601990049751246, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1809366', 'n_tokens_mistral': 308, 'n_tokens_neox': 287, 'n_words': 83}