UNPKG

@pushrocks/smartpath

Version:

offers smart ways to handle paths

19 lines (18 loc) 784 B
export declare type TPathType = 'url' | 'local'; /** * returns the type of the given path. Can be "url" or "local" */ export declare const type: (pathStringArg: string) => TPathType; /** * gets the dirname from import.meta.url */ export declare const dirnameFromImportMetaUrl: (importMetaUrlArg: string) => string; /** * returns homedir as absolute path * @param pathArgument if a pathargument is given, ~ is being replaced with the homedir * @returns */ export declare const home: (pathArgument?: string) => string; export declare type TSystemArg = 'dynamic' | 'windows' | 'linux' | 'osx'; export declare const pathLevels: (pathArg: string, systemArg?: TSystemArg) => string[]; export declare const pathLevelsBackwards: (pathArg: string, systemArg?: TSystemArg) => string[];