any-cache
TypeScript icon, indicating that this package has built-in type declarations

0.0.5 • Public • Published

AnyCache

CI Coverage Version License

Function level cache library.

Install

npm i any-cache --save

Example

a simple example

  class TestCls {
    @helper.cache('text')
    async text(t: string) { return t; }
 
    @helper.cacheEvict('text')
    async evictText(t: string) { return t; }
 
    @helper.cache((desc: string) => `desc_${desc}`)
    async desc(desc: string, sub: string = '') { return desc + sub; }
 
    @helper.cacheEvict((desc: string) => `desc_${desc}`)
    async evictDesc(desc: string) { }
  }

See the test case for details.

Readme

Keywords

Package Sidebar

Install

npm i any-cache

Weekly Downloads

3

Version

0.0.5

License

MIT

Last publish

Collaborators

  • zhang740