Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Strategy Cache

A package for providing caching.

Usage

import { Cache, InMemoryCacheStrategy } from 'strategy-cache'

const cache = new Cache(new InMemoryCacheStrategy())

const key = 'answer'
const ttl = 300
const calculate = () => Promise.resolve(2+2)

const answer = cache.getOrSet(key, ttl, calculate)

See the integration tests for more usage examples.

Strategies

See the doc for other strategies and how to use them.

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Used by

Contributors

Languages