Options
All
  • Public
  • Public/Protected
  • All
Menu

Index

Variables

Const basename

basename: (p: string, ext?: undefined | string) => string = _path.basename

Return the last portion of a path. Similar to the Unix basename command. Often used to extract the file name from a fully qualified path.

param
param

Type declaration

    • (p: string, ext?: undefined | string): string
    • Parameters

      • p: string
      • Optional ext: undefined | string

      Returns string

Const delimiter

delimiter: string = ":"

The platform-specific file delimiter. Always ':'.

Const extname

extname: (path: string) => string = _path.extname

Return the extension of the path, from the last '.' to end of string in the last portion of the path. If there is no '.' in the last portion of the path or the first character of it is '.', then it returns an empty string

param

Type declaration

    • (path: string): string
    • Parameters

      • path: string

      Returns string

Const join

join: (...paths: string[]) => string = _path.join

Join all arguments together and normalize the resulting path.

param

Type declaration

    • (...paths: string[]): string
    • Parameters

      • Rest ...paths: string[]

      Returns string

Const relative

relative: (from: string, to: string) => string = _path.relative

Solve the relative path from {from} to {to}. At times we have two absolute paths, and we need to derive the relative path from one to the other. This is actually the reverse transform of path.resolve.

param
param

Type declaration

    • (from: string, to: string): string
    • Parameters

      • from: string
      • to: string

      Returns string

Const resolve

resolve: (...pathSegments: string[]) => string = _path.resolve

The right-most parameter is considered {to}. Other parameters are considered an array of {from}.

Starting from leftmost {from} parameter, resolves {to} to an absolute path.

If {to} isn't already absolute, {from} arguments are prepended in right to left order, until an absolute path is found. If after using all {from} paths still no absolute path is found, the current working directory is used as well. The resulting path is normalized, and trailing slashes are removed unless the path gets resolved to the root directory.

param

Type declaration

    • (...pathSegments: string[]): string
    • Parameters

      • Rest ...pathSegments: string[]

      Returns string

Const sep

sep: string = "/"

The platform-specific file separator. Always '/'.

Functions

dirname

  • dirname(p: string): string
  • Return the directory name of a path. Similar to the Unix dirname command.

    Parameters

    • p: string

    Returns string

normalize

  • normalize(p: string): string
  • Normalize a string path, reducing '..' and '.' parts. When multiple slashes are found, they're replaced by a single one; when the path contains a trailing slash, it is preserved. When the path is normalized to a single . part, the platform seperator is returned. When the path has trailing platform separator(s), they are removed. All paths are prefixed with the platform separator.

    Parameters

    • p: string

    Returns string

Legend

  • Variable
  • Function
  • Type alias
  • Type alias with type parameter
  • Interface
  • Interface with type parameter
  • Class
  • Class with type parameter
  • Enumeration

Generated using TypeDoc