evalution
    Preparing search index...

    Interface FileProvider

    Abstraction over file system I/O used throughout Evalution.

    Swap in a different implementation to adapt Evalution to non-local environments or to make tests fully in-memory. The MemoryFileProvider (in ./file-provider-memory.ts) keeps everything in-process with no Node-only dependencies; LocalFileProvider (in ./file-provider-local.ts) is the default implementation for production use.

    interface FileProvider {
        deleteFile(filePath: string): Promise<void>;
        glob(pattern: string, options?: GlobOptions): AsyncIterableIterator<string>;
        import(filePath: string): Promise<any>;
        readFile(filePath: string): Promise<string>;
        watch(
            patterns: readonly string[],
            options: FileWatchOptions,
            callback: FileWatchCallback,
        ): () => void;
        writeFile(filePath: string, content: string): Promise<void>;
    }

    Implemented by

    Index

    Methods

    • Deletes the file at filePath. When the path falls inside an active watch scope, the watcher callback is invoked automatically with 'remove'.

      Parameters

      • filePath: string

      Returns Promise<void>

    • Returns an async iterator that yields paths matching pattern.

      Parameters

      Returns AsyncIterableIterator<string>

    • Dynamically imports the module at filePath and returns its namespace object. Rejects if the file does not exist.

      Parameters

      • filePath: string

      Returns Promise<any>

    • Reads the file at filePath and returns its content as a UTF-8 string. Rejects if the file does not exist.

      Parameters

      • filePath: string

      Returns Promise<string>

    • Writes content to filePath, creating or overwriting the file. When the path falls inside an active watch scope, the watcher callback is invoked automatically.

      Parameters

      • filePath: string
      • content: string

      Returns Promise<void>