Class FilePath

The class of file paths in the tool.

Constructors

Properties

Accessors

Constructors

  • Defining the initial values of the class instance.

    Parameters

    • strP: string

      An absolute or relative to workspace path, if not, the relativeTo parameter must have a value.

    • OptionalrelativeTo: string

      The path relative to the location of the strP parameter if wasn't relative to the workspace.

    Returns FilePath

    If strP is not absolute or relative to workspace path.

Properties

extension: string

File extension after the first dot.

const p = new FilePath('example.test.js')
// p.extension = 'test.js'
folder: string

File's parent folder/directory name.

const p = new FilePath('main/example.js')
// p.folder = 'main'
name: string

File name without extension.

const p = new FilePath('example.test.js')
// p.name = 'example'
root: string

File's absolute path before the parent folder/directory.

const p = new FilePath('C:/users/someone/main/example.js')
// p.root = 'C:/users/someone'

Accessors

  • get fullName(): string
  • Returns string

    • File name with extension
  • get fullPath(): string
  • Returns string

    • Absolute file path