[add] implement vulnerability checking and advisory fetching, enhance repo processing, and add utility functions

This commit is contained in:
2025-08-19 19:13:24 +01:00
parent 52d0c7b649
commit 2c30fce7c8
14 changed files with 700 additions and 15 deletions

View File

@@ -9,9 +9,9 @@ import { resolve } from "node:path";
* @param {()=>Promise<T>} asyncCallback
* @returns {Promise<T>}
*/
export async function cacheFunctionOutput(fileName, asyncCallback, silent=false) {
export async function cacheFunctionOutput(fileName, asyncCallback, silent=false,passthrough=false) {
const fileLoc = resolve('../cache-repos', fileName);
if (existsSync(fileLoc)) {
if (!passthrough && existsSync(fileLoc)) {
!silent && console.log("[cacher] Using cached ", fileLoc);
const fileContents = (await readFile(fileLoc)).toString();
return JSON.parse(fileContents);