加入了node_modules

添加了新的功能项
This commit is contained in:
zyb
2025-05-13 21:23:41 +08:00
parent 8d53374568
commit 0c0b5d869c
3589 changed files with 893641 additions and 233 deletions

24
node_modules/totalist/dist/index.js generated vendored Normal file
View File

@@ -0,0 +1,24 @@
const { join, resolve } = require('path');
const { readdir, stat } = require('fs');
const { promisify } = require('util');
const toStats = promisify(stat);
const toRead = promisify(readdir);
async function totalist(dir, callback, pre='') {
dir = resolve('.', dir);
await toRead(dir).then(arr => {
return Promise.all(
arr.map(str => {
let abs = join(dir, str);
return toStats(abs).then(stats => {
return stats.isDirectory()
? totalist(abs, callback, join(pre, str))
: callback(join(pre, str), abs, stats)
});
})
);
});
}
exports.totalist = totalist;

22
node_modules/totalist/dist/index.mjs generated vendored Normal file
View File

@@ -0,0 +1,22 @@
import { join, resolve } from 'path';
import { readdir, stat } from 'fs';
import { promisify } from 'util';
const toStats = promisify(stat);
const toRead = promisify(readdir);
export async function totalist(dir, callback, pre='') {
dir = resolve('.', dir);
await toRead(dir).then(arr => {
return Promise.all(
arr.map(str => {
let abs = join(dir, str);
return toStats(abs).then(stats => {
return stats.isDirectory()
? totalist(abs, callback, join(pre, str))
: callback(join(pre, str), abs, stats)
});
})
);
});
}