Angular Modernizer
    Preparing search index...

    Real file system adapter - implements both FileSystemAdapter and ts-morph's FileSystemHost. This is the production implementation used in the CLI.

    Implements

    Index

    Constructors

    Methods

    • Copies a file or directory recursively.

      Parameters

      • srcPath: string
      • destPath: string

      Returns Promise<void>

    • Copies a file or directory recursively and synchronously.

      Parameters

      • srcPath: string
      • destPath: string

      Returns void

    • Create a directory (and parent directories if needed).

      Parameters

      • path: string

        Directory path to create

      Returns Promise<void>

      Error if directory cannot be created

    • Delete a file.

      Parameters

      • path: string

        Path to the file to delete

      Returns Promise<void>

      Error if file doesn't exist or cannot be deleted

    • Deletes a file synchronously.

      Parameters

      • path: string

      Returns void

      Error if the file cannot be deleted

    • Check if a path points to a directory.

      Parameters

      • dirPath: string

        Path to check

      Returns Promise<boolean>

      Promise resolving to true if path is a directory, false otherwise

    • Returns true when the path exists and is a directory.

      Parameters

      • dirPath: string

      Returns boolean

    • Check if a file or directory exists.

      Parameters

      • path: string

        Path to check

      Returns Promise<boolean>

      Promise resolving to true if exists, false otherwise

    • Check if a path points to a file (not a directory).

      Parameters

      • filePath: string

        Path to check

      Returns Promise<boolean>

      Promise resolving to true if path is a file, false otherwise

    • Returns true when the path exists and is a file.

      Parameters

      • filePath: string

      Returns boolean

    • Returns process.cwd().

      Returns string

    • Get file statistics.

      Parameters

      • path: string

        File path

      Returns Promise<{ mtime: number; size: number }>

      Promise resolving to file stats with mtime and size

      Error if file doesn't exist

    • Not implemented: always resolves to an empty array.

      Parameters

      • _patterns: readonly string[]

      Returns Promise<string[]>

    • Not implemented: always returns an empty array.

      Parameters

      • _patterns: readonly string[]

      Returns string[]

    • Returns false on Windows and macOS, true on other platforms.

      Returns boolean

    • Creates a directory and its parents synchronously.

      Parameters

      • dirPath: string

      Returns void

    • Renames or moves a file or directory.

      Parameters

      • srcPath: string
      • destPath: string

      Returns Promise<void>

    • Renames or moves a file or directory synchronously.

      Parameters

      • srcPath: string
      • destPath: string

      Returns void

    • List all files in a directory (non-recursive).

      Parameters

      • path: string

        Directory path

      Returns Promise<string[]>

      Promise resolving to array of file/directory names

      Error if directory doesn't exist or cannot be read

    • Lists the direct entries of a directory synchronously.

      Parameters

      • dirPath: string

      Returns RuntimeDirEntry[]

      Entries with full paths as name

    • Read a file's contents as a UTF-8 string.

      Parameters

      • path: string

        Absolute or relative path to the file

      Returns Promise<string>

      Promise resolving to file contents

      Error if file doesn't exist or cannot be read

    • Reads a file synchronously.

      Parameters

      • filePath: string
      • Optionalencoding: string

        Encoding, defaults to utf-8

      Returns string

    • Resolves symbolic links and returns the canonical path.

      Parameters

      • path: string

      Returns string

    • Write content to a file, creating directories if needed.

      Parameters

      • path: string

        Absolute or relative path to the file

      • content: string

        String content to write

      Returns Promise<void>

      Error if write operation fails

    • Writes a file synchronously, creating the parent directory if missing.

      Parameters

      • filePath: string
      • fileText: string

      Returns void