Interface FlexiPath

A flexible path builder and walker

Hierarchy

Properties

base: string

The file name including extension (if any) such as 'index.html'

children: ChildQuery

The [[subDrirectories]] and [[files]] for a given path

depth: number

The depth of this path

dir: string

The full directory path such as '/home/user/dir' or 'c:\path\dir'

ext: string

The file extension (if any) such as '.html'

files: ChildQuery

The files in the current path

name: string

The file name without extension (if any) such as 'index'

parent: ParentQuery

The parent directory of the path

path: string

The normalized string representation of the path

root: string

The root of the path such as '/' or 'c:'

segments: string[]
subDirectories: ChildQuery

The subdirectories of the path and a path builder

Methods

  • Get the diff for two paths

    Parameters

    • path: Path

      The path to diff against

    Returns [FlexiPath, FlexiPath]

    Example

    const first = flexi.path("some/common/and/unique/paths");
    const second = flexi.path("some/common/with/other/paths");
    const diff = first.diff(second);
    //==> [ "and/unique/paths", "with/other/paths" ]
  • Checks if this path equals another path

    Parameters

    • other: Path

      the path to compare with

    • Optional options: {
          ignoreFileExtension?: boolean;
      }

      options

      • Optional ignoreFileExtension?: boolean

    Returns boolean

Generated using TypeDoc