Bug:Fix file validation issue
[vnfsdk/refrepo.git] / vnfmarket / src / main / webapp / vnfmarket / node_modules / stream-counter / index.js
1 module.exports = ByteCounter;
2
3 var Writable = require('readable-stream').Writable;
4 var util = require('util');
5
6 util.inherits(ByteCounter, Writable);
7 function ByteCounter(options) {
8   Writable.call(this, options);
9   this.bytes = 0;
10 }
11
12 ByteCounter.prototype._write = function(chunk, encoding, cb) {
13   this.bytes += chunk.length;
14   this.emit('progress');
15   cb();
16 };