MCPcopy Create free account
hub / github.com/SAP-samples/cloud-cap-hana-swapi / write

Function write

scripts/scraper/cache.js:23–27  ·  view source on GitHub ↗
(pageTitle, data)

Source from the content-addressed store, hash-verified

21}
22
23async function write(pageTitle, data) {
24 await fs.mkdir(CACHE_DIR, { recursive: true })
25 const file = cacheKey(pageTitle)
26 await fs.writeFile(file, JSON.stringify({ cachedAt: Date.now(), data }, null, 2))
27}
28
29module.exports = { read, write }

Callers

nothing calls this directly

Calls 1

cacheKeyFunction · 0.85

Tested by

no test coverage detected