Options
All
  • Public
  • Public/Protected
  • All
Menu

Class which holds helper tools when working with files.

export
class

FileUtil

Hierarchy

  • FileUtil

Index

Methods

createDirectory

  • createDirectory(filePath: string): Promise<boolean>
  • Create directory if not exist

    Parameters

    • filePath: string

      path where the directory should be created.

    Returns Promise<boolean>

    directory created

isDirectory

  • isDirectory(filePath: string): boolean
  • Check if a filePath represents the path for a directory or a file

    Parameters

    • filePath: string

      relative or absolute file path

    Returns boolean

    check if path is dir

joinPaths

  • joinPaths(...paths: string[]): string
  • Join list of paths

    Parameters

    • Rest ...paths: string[]

      array of paths that need to be merged

    Returns string

    merged path

normalizePath

  • normalizePath(filePath: string): string
  • Normalize folder path

    Parameters

    • filePath: string

      path to be normalized

    Returns string

    normalized path

writeFile

  • writeFile(filePath: string, content: string): Promise<boolean>
  • Writes content into file.

    Parameters

    • filePath: string

      destination file

    • content: string

      content to be written

    Returns Promise<boolean>

    file written

Generated using TypeDoc