UNPKG

haraka-plugin-wildduck

Version:

Haraka plugin for processing incoming messages for the WildDuck IMAP server

21 lines (17 loc) 439 B
'use strict'; const Transform = require('stream').Transform; class StreamCollect extends Transform { constructor(options) { super(); this.options = options || {}; this.chunks = []; this.chunklen = 0; } _transform(chunk, encoding, done) { this.chunks.push(chunk); this.chunklen += chunk.length; this.push(chunk); done(); } } module.exports = StreamCollect;