dcache_content
v3.0.0
Published
cache utility with dynamodb
Downloads
16
Readme
DCache
It expects the following envs:
AWS_DEFAULT_REGION (defaults to 'us-east-1')
AWS_ACCESS_KEY_ID
AWS_SECRET_ACCESS_KEY
Install
npm i dcache_content
How to use
// import the class
import { CacheTool } from 'dcache_content'
// create the instance and pass the function that will create the cache record
const cacheTool = new CacheTool(yourAsyncCallbackGoesHere)
// just async 'getValue' and let we do the hard work
const value = await cacheTool.getValue(content, metadata, expirationHours)
```