Options
All
  • Public
  • Public/Protected
  • All
Menu

Interface ProjectSync

Synchronous project operations. Should generally be avoided except for testing or in other special cases.

Hierarchy

Index

Properties

Readonly cache

cache: Record<string, object>

Use to cache arbitrary content associated with this instance. Use for smallish objects that are expensive to compute.

id

Readonly name

name: string

Methods

addFileSync

  • addFileSync(path: string, content: string): void
  • Add the given file to the project. Path can be nested. Content is a literal string. This method will throw an error if it is not successful.

    Parameters

    • path: string

      path to file relative to root of project

    • content: string

      The content to be placed in the new file

    Returns void

deleteDirectorySync

  • deleteDirectorySync(path: string): void
  • Recursively deletes a directory and all its contents with the given path. Errors when deleting the directory are caught.

    Parameters

    • path: string

      path to directory relative to root of project

    Returns void

deleteFileSync

  • deleteFileSync(path: string): void
  • Delete the given file from the project. Path can be nested. Errors when deleting the file are caught.

    Parameters

    • path: string

      path to file relative to root of project

    Returns void

directoryExistsSync

  • directoryExistsSync(path: string): boolean
  • Does a directory with the given path exist?

    Parameters

    • path: string

      path to directory relative to root of project

    Returns boolean

fileExistsSync

  • fileExistsSync(path: string): boolean
  • Does a regular file with the given path exist? It will return false if the file does not exist or is not a regular file.

    Parameters

    • path: string

      path to file relative to root of project

    Returns boolean

findFileSync

  • findFileSync(path: string): File
  • Find a regular file with the given path. Return undefined if file does not exist or is not a regular file.

    Parameters

    • path: string

      path to file relative to root of project

    Returns File

makeExecutableSync

  • makeExecutableSync(path: string): void
  • Makes a file executable. Other permissions are unchanged.

    Parameters

    • path: string

      path to file relative to root of project

    Returns void

Generated using TypeDoc