UNPKG

@prooheckcp/file-manager

Version:

A wrapper for Nodes file system

13 lines (12 loc) 601 B
import { Folder } from "./FileManager.js"; import path from "path"; import { fileURLToPath } from 'url'; const __filename = fileURLToPath(import.meta.url); const __dirname = path.dirname(__filename); // cannot resolve path let exampleFolder = await Folder.create(path.join(__dirname, "..", "Test")); let targetFolder = await Folder.create(path.join(exampleFolder.Directory, "Target")); let target2Folder = await Folder.create(path.join(exampleFolder.Directory, "Target2")); let ancestors = await target2Folder.GetAncestors(); console.log(ancestors); await targetFolder.Clone(target2Folder.Directory);