0.0.3 • Published 2 years ago

typeorm-lru-cache v0.0.3

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

typeorm-lru-cache

An in-memory lru cache for typeorm

Basically just a wrapper for lru-cache

Usage

Use the provider for the cache when configuring typeorm

import LRUCacheProvider from 'typeorm-lru-cache'
{
    ...
    cache: {
        provider: () => {
            return new LRUCacheProvider({
              max: 1000,

              // how long to live in ms
              ttl: 20000,

              // return stale items before removing from cache?
              allowStale: false,

              updateAgeOnGet: false,
              updateAgeOnHas: false,
            });
          },
    }
}
0.0.3

2 years ago

0.0.2

2 years ago

0.0.1

2 years ago