cache.ts

Source

3 documented symbols. Read the signatures first, then expand each item for parameters, return types, and examples.

Reference

fncomputeCacheKey(templateSource: string, props: Record<string, unknown>, width: number, height: number): stringComputes a cache key from template + props + options.

Computes a cache key from template + props + options.

View source

Parameters

  • templateSource string
  • props Record
  • width number
  • height number

Returns

string
fngetCached(cacheDir: string, key: string): Promise<Buffer | null>Checks if a cached PNG exists for the given key. Returns the cached file path i…

Checks if a cached PNG exists for the given key. Returns the cached file path if found, null otherwise.

View source

Parameters

  • cacheDir string
  • key string

Returns

Promise
fnwriteCache(cacheDir: string, key: string, png: Buffer): Promise<void>Writes a PNG buffer to the cache.

Writes a PNG buffer to the cache.

View source

Parameters

  • cacheDir string
  • key string
  • png Buffer

Returns

Promise