vmind_dir_scan
Version:
A library to scan the file system based on a root folder. The library will scan recursively and send a callback for every file and directory it finds, including details such as age, name, path, and size.
19 lines (18 loc) • 706 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.FS_TYPE = void 0;
const zod_1 = require("zod");
const fsEventSchema = zod_1.z.object({
name: zod_1.z.string().describe("file or dir name"),
path: zod_1.z.string().describe("full path"),
type: zod_1.z.string().describe("file or dir type"),
ageInSeconds: zod_1.z.number().describe("age of file in seconds"),
ageInDays: zod_1.z.number().describe("age of file in days"),
size: zod_1.z.number().describe("file size in MB"),
});
var FS_TYPE;
(function (FS_TYPE) {
FS_TYPE["FILE"] = "file";
FS_TYPE["DIR"] = "dir";
FS_TYPE["ERROR"] = "error";
})(FS_TYPE || (exports.FS_TYPE = FS_TYPE = {}));