Options
All
  • Public
  • Public/Protected
  • All
Menu

Hierarchy

  • Path

Index

Constructors

  • new Path(raw: string): Path

Properties

_dir: Path
base: string
ext: string
isAbsolute: boolean
isRoot: boolean
name: string
raw: string
root: undefined | Path
separator: "/" = '/'

Accessors

  • get hasDir(): boolean
  • Returns true if this has a parent directory, false otherwise.

    This implementation returns true if and only if this is not the root dir and there is a path separator in the raw path.

    Returns boolean

Methods

  • computeRoot(): undefined | Path
  • fsPath(format?: Format): string
  • Converts the current path into a file system path.

    Parameters

    • Optional format: Format

      Determines the format of the path. If undefined, the format will be determined by the OS.backend.type value.

    Returns string

    A file system path.

  • isEqualOrParent(path: Path): boolean
  • join(...paths: string[]): Path
  • relativity(path: Path): number
  • resolve(...paths: string[]): undefined | Path
  • Parameters

    • Rest ...paths: string[]

      portions of a path

    Returns undefined | Path

    a new Path if an absolute path can be computed from the segments passed in + this.raw If no absolute path can be computed, returns undefined.

    Processes the path segments passed in from right to left (reverse order) concatenating until an absolute path is found.

  • toString(): string
  • isDrive(segment: string): boolean
  • normalizeDrive(path: string): string
  • normalizePathSeparator(path: string): string
  • tildify(resourcePath: string, home: string): string
  • Tildify path, replacing home with ~ if user's home is present at the beginning of the path. This is a non-operation for Windows.

    Parameters

    • resourcePath: string
    • home: string

    Returns string

  • untildify(resourcePath: string, home: string): string
  • Untildify path, replacing ~ with home if ~ present at the beginning of the path. This is a non-operation for Windows.

    Parameters

    • resourcePath: string
    • home: string

    Returns string

  • windowsPath(path: string): string
  • Creates a windows path from the given path string. A windows path uses an upper case drive letter and backwards slashes.

    Parameters

    • path: string

      The input path

    Returns string

    Windows style path