first commit

This commit is contained in:
2026-09-08 20:28:54 +08:00
commit 2ada8d3d5a
37380 changed files with 4886169 additions and 0 deletions
+23
View File
@@ -0,0 +1,23 @@
var Entry, Stats,
extend = function(child, parent) { for (var key in parent) { if (hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; },
hasProp = {}.hasOwnProperty;
Stats = require('./stats');
Entry = (function(superClass) {
extend(Entry, superClass);
function Entry(name, mode, size, mtime) {
this.name = name;
Entry.__super__.constructor.call(this, mode, size, mtime);
}
Entry.prototype.toString = function() {
return this.name;
};
return Entry;
})(Stats);
module.exports = Entry;
+31
View File
@@ -0,0 +1,31 @@
var PullTransfer, Stream,
extend = function(child, parent) { for (var key in parent) { if (hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; },
hasProp = {}.hasOwnProperty;
Stream = require('stream');
PullTransfer = (function(superClass) {
extend(PullTransfer, superClass);
function PullTransfer() {
this.stats = {
bytesTransferred: 0
};
PullTransfer.__super__.constructor.call(this);
}
PullTransfer.prototype.cancel = function() {
return this.emit('cancel');
};
PullTransfer.prototype.write = function(chunk, encoding, callback) {
this.stats.bytesTransferred += chunk.length;
this.emit('progress', this.stats);
return PullTransfer.__super__.write.call(this, chunk, encoding, callback);
};
return PullTransfer;
})(Stream.PassThrough);
module.exports = PullTransfer;
+40
View File
@@ -0,0 +1,40 @@
var EventEmitter, PushTransfer,
extend = function(child, parent) { for (var key in parent) { if (hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; },
hasProp = {}.hasOwnProperty;
EventEmitter = require('events').EventEmitter;
PushTransfer = (function(superClass) {
extend(PushTransfer, superClass);
function PushTransfer() {
this._stack = [];
this.stats = {
bytesTransferred: 0
};
}
PushTransfer.prototype.cancel = function() {
return this.emit('cancel');
};
PushTransfer.prototype.push = function(byteCount) {
return this._stack.push(byteCount);
};
PushTransfer.prototype.pop = function() {
var byteCount;
byteCount = this._stack.pop();
this.stats.bytesTransferred += byteCount;
return this.emit('progress', this.stats);
};
PushTransfer.prototype.end = function() {
return this.emit('end');
};
return PushTransfer;
})(EventEmitter);
module.exports = PushTransfer;
+54
View File
@@ -0,0 +1,54 @@
var Fs, Stats,
extend = function(child, parent) { for (var key in parent) { if (hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; },
hasProp = {}.hasOwnProperty;
Fs = require('fs');
Stats = (function(superClass) {
extend(Stats, superClass);
Stats.S_IFMT = 0xf000;
Stats.S_IFSOCK = 0xc000;
Stats.S_IFLNK = 0xa000;
Stats.S_IFREG = 0x8000;
Stats.S_IFBLK = 0x6000;
Stats.S_IFDIR = 0x4000;
Stats.S_IFCHR = 0x2000;
Stats.S_IFIFO = 0x1000;
Stats.S_ISUID = 0x800;
Stats.S_ISGID = 0x400;
Stats.S_ISVTX = 0x200;
Stats.S_IRWXU = 0x1c0;
Stats.S_IRUSR = 0x100;
Stats.S_IWUSR = 0x80;
Stats.S_IXUSR = 0x40;
Stats.S_IRWXG = 0x38;
Stats.S_IRGRP = 0x20;
function Stats(mode, size, mtime) {
this.mode = mode;
this.size = size;
this.mtime = new Date(mtime * 1000);
}
return Stats;
})(Fs.Stats);
module.exports = Stats;