Skip to content

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

License

Notifications You must be signed in to change notification settings

holepunchto/throwaway-local-cache

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

Resources

License

Stars

Watchers

Forks

Packages

No packages published