first commit

This commit is contained in:
s.golasch
2023-08-01 13:49:46 +02:00
commit 1fc239fd54
20238 changed files with 3112246 additions and 0 deletions

43
build/node_modules/read-chunk/index.js generated vendored Normal file
View File

@@ -0,0 +1,43 @@
'use strict';
var fs = require('fs');
module.exports = function (filepath, pos, len, cb) {
var buf = new Buffer(len);
fs.open(filepath, 'r', function (err, fd) {
if (err) {
return cb(err);
}
fs.read(fd, buf, 0, len, pos, function (err, bytesRead, buf) {
if (err) {
return cb(err);
}
fs.close(fd, function (err) {
if (err) {
return cb(err);
}
if (bytesRead < len) {
buf = buf.slice(0, bytesRead);
}
cb(null, buf);
});
});
});
};
module.exports.sync = function (filepath, pos, len) {
var buf = new Buffer(len);
var fd = fs.openSync(filepath, 'r');
var bytesRead = fs.readSync(fd, buf, 0, len, pos);
fs.closeSync(fd);
if (bytesRead < len) {
buf = buf.slice(0, bytesRead);
}
return buf;
};