evals
scenario-1
scenario-10
scenario-2
scenario-3
scenario-4
scenario-5
scenario-6
scenario-7
scenario-8
scenario-9
A module that retrieves cached content directly by its integrity digest without needing cache keys.
/**
* Reads cached content by its integrity digest and returns the bytes plus any stored metadata.
*
* @param {string} cacheDir path to the cache directory
* @param {string} digest integrity digest (e.g., sha512-...)
* @param {{ expectedSize?: number, memoize?: boolean }} [options]
* @returns {Promise<{ data: Buffer, metadata?: any, size: number, integrity: string }>}
*/
export async function fetchByDigest(cacheDir, digest, options);
/**
* Returns a readable stream of cached content identified only by the digest.
*
* @param {string} cacheDir path to the cache directory
* @param {string} digest integrity digest (e.g., sha512-...)
* @param {{ memoize?: boolean }} [options]
* @returns {NodeJS.ReadableStream}
*/
export function streamByDigest(cacheDir, digest, options);
/**
* Copies cached content addressed by digest to a destination file path.
*
* @param {string} cacheDir path to the cache directory
* @param {string} digest integrity digest (e.g., sha512-...)
* @param {string} destination absolute or relative destination file path
* @param {{ mode?: number, memoize?: boolean }} [options]
* @returns {Promise<{ size: number, integrity: string }>}
*/
export async function copyByDigest(cacheDir, digest, destination, options);Digest-addressable cache storage and retrieval utilities.