null-duplex-stream
Version:
a /dev/null duplex stream
22 lines (15 loc) • 455 B
JavaScript
var Duplex = require('stream').Duplex;
var util = require('util');
function NullDuplexStream(options) {
Duplex.call(this, options);
}
util.inherits(NullDuplexStream, Duplex);
NullDuplexStream.prototype._write = function (chunk, encoding, callback) {
// write to this NullDuplexStream
callback();
};
NullDuplexStream.prototype._read = function (n) {
// read from this NullDuplexStream
this.push(null);
};
module.exports = NullDuplexStream;