Options
All
  • Public
  • Public/Protected
  • All
Menu

Class holding all the imports from the given paths.

Hierarchy

  • FileManager

Index

Methods

  • fileExists(fileName: string): boolean
  • Checks if the file exists. (Hopefully)

    Parameters

    • fileName: string

      The name of the file

    Returns boolean

  • getFiles(path: string, recursive?: boolean): string | string[]
  • Given a path to whether a file or a directory, this finds all the .ts files. If the path is a directory, it will return all .ts files in that directory. If recursive is true, it will search the directory recursively. Accepts wildcards.

    Parameters

    • path: string

      Path to a file or directory.

    • Optional recursive: boolean

      If this should work recursively.

    Returns string | string[]

  • readFile(path: string): undefined | string
  • Reads the file from a given path.

    Parameters

    • path: string

      The path to read from.

    Returns undefined | string

  • reloadFromDisk(path: string): void
  • Read the files from the disk. Also used in the constructor.

    Parameters

    • path: string

      Path for the file to read in

    Returns void

  • write(path: string, newContent: string, newPath?: string): void
  • Writes the new content into the path.

    Parameters

    • path: string

      Path of the file

    • newContent: string

      The new content

    • Optional newPath: string

      If given, the new entry point path

    Returns void

Constructors

  • new FileManager(tsconfigPath: string, filePaths: string | string[]): FileManager
  • Constructor. This takes a ts config to search for it's target and some file paths to read them in and construct Imports from.

    Parameters

    • tsconfigPath: string

      The path for the ts config

    • filePaths: string | string[]

      One or many file paths for the .ts files

    Returns FileManager

Properties

imports: Map<string, { imports: Import[]; sourceFile: SourceFile }> = ...

The imported files in their read in form.

tsConfig: any

The typescript config.

Generated using TypeDoc