Function cachedMtime

  • Cache a synchronous FS function that takes a path as a single argument. The result cache will be invalidated whenever the mtime of the path changes. May specify minimum time between stat() calls in ms, and provide both a results cache and mtime cache.

    Type Parameters

    • R

    Parameters

    • fn: ((path) => R)
        • (path): R
        • Parameters

          • path: string

          Returns R

    • statFreqMs: number = 10
    • cache: MapLike<string, R> = ...
    • mtimeCache: MapLike<string, [mtime: number, lastStatTime: number]> = ...

    Returns MtimeCachedMethod<R>

Generated using TypeDoc