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

Function read

scripts/scraper/cache.js:12–21  ·  view source on GitHub ↗
(pageTitle)

Source from the content-addressed store, hash-verified

10}
11
12async function read(pageTitle) {
13 const file = cacheKey(pageTitle)
14 try {
15 const raw = await fs.readFile(file, 'utf8')
16 const entry = JSON.parse(raw)
17 return entry.data
18 } catch {
19 return null
20 }
21}
22
23async function write(pageTitle, data) {
24 await fs.mkdir(CACHE_DIR, { recursive: true })

Callers

nothing calls this directly

Calls 1

cacheKeyFunction · 0.85

Tested by

no test coverage detected