UNPKG

@stryke/fs

Version:

A package containing various file system utilities that expand the functionality of NodeJs's built-in `fs` module.

48 lines 1.65 kB
//#region src/get-workspace-root.d.ts declare const WORKSPACE_ROOT_CONTENT: string[]; declare const PROJECT_ROOT_CONTENT: string[]; /** * Get the workspace root path * * @param dir - A directory to start the search from * @returns The workspace root path */ declare function getWorkspaceRoot(dir?: any): any; /** * Check if the given directory is the workspace root * * @param dir - A directory to check * @returns True if the directory is the workspace root, false otherwise */ declare function isWorkspaceRoot(dir?: any): boolean; /** * Get the project root path * * @param dir - A directory to start the search from * @returns The project root path */ declare function getProjectRoot(dir?: any): any; /** * Check if the given directory is the project root * * @param dir - A directory to check * @returns True if the directory is the project root, false otherwise */ declare function isProjectRoot(dir?: any): boolean; /** * Find the file path relative to the workspace root path. * * @param filePath - The file path to process * @returns The file path relative to the workspace root */ declare function relativeToWorkspaceRoot(filePath: string): string; /** * Find the file path relative to the project root path. * * @param filePath - The file path to process * @returns The file path relative to the project root */ declare function relativeToProjectRoot(filePath: string): string; //#endregion export { PROJECT_ROOT_CONTENT, WORKSPACE_ROOT_CONTENT, getProjectRoot, getWorkspaceRoot, isProjectRoot, isWorkspaceRoot, relativeToProjectRoot, relativeToWorkspaceRoot }; //# sourceMappingURL=get-workspace-root.d.cts.map