npm install throwaway-local-cache
const Cache = require('throwaway-cache-storage')
const c = new Cache('./cache') // pass the local folder to use
await c.get('key') // get an entry
c.queuePut('key', { value: true }) // queue a put, will be persisted later
c.queueDelete('key') // queue a deletion, will be persisted later
await c.flush() // force persist it
Apache-2.0