educastellano / throwaway-local-cache

Maintain a fast local cache when persistance isnt a 100% requirement

Repository from Github https://github.comeducastellano/throwaway-local-cacheRepository from Github https://github.comeducastellano/throwaway-local-cache

throwaway-local-cache

npm install throwaway-local-cache

Usage

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

License

Apache-2.0

About

Maintain a fast local cache when persistance isnt a 100% requirement

License:Apache License 2.0


Languages

Language:JavaScript 100.0%