Dependicus API Reference
    Preparing search index...

    Class CacheService

    Index

    Constructors

    Methods

    • Check if cached data is valid (exists and matches the current hash of the invalidation inputs).

      Parameters

      • key: string

        Cache key (e.g., 'pnpm-list')

      • invalidation: InvalidationInput

        Path, or paths, whose contents determine cache validity (e.g., a lockfile)

      Returns Promise<boolean>

    • Read cached data for a given key.

      Parameters

      • key: string

        Cache key

      Returns Promise<string>

    • Read permanent cache if it exists.

      Parameters

      • key: string

        Cache key

      Returns Promise<string | undefined>

    • Write data to cache along with the hash of the invalidation inputs.

      Parameters

      • key: string

        Cache key

      • data: string

        Data to cache

      • invalidation: InvalidationInput

        Path, or paths, whose contents determine cache validity

      Returns Promise<void>

    • Write data to cache without invalidation file (cache permanently).

      Parameters

      • key: string

        Cache key

      • data: string

        Data to cache

      Returns Promise<void>