1.0.2 • Published 5 years ago

typeorm-in-memory-cache v1.0.2

Weekly downloads
640
License
MIT
Repository
-
Last release
5 years ago

typeorm-in-memory-cache

An in-memory cache for typeorm

Badically just a wrapper for node-cache

Usage

Use the provider for the cache when configuring typeorm

import InMemoryCacheProvider from 'typeorm-in-memory-cache'
{
    ...
    cache: {
        provider() {
            return new InMemoryCacheProvider()
        }
    }
}

Maybe you are a special person with special config needs.

import InMemoryCacheProvider from 'typeorm-in-memory-cache'
import NodeCache = require('node-cache')
{
    ...
    cache: {
        provider() {
            const cache = new NodeCache({
              stdTTL: 420,
              checkperiod: 69,
              etc: 'more options',
            })
            return new InMemoryCacheProvider(cache)
        }
    }
}
1.0.2

5 years ago

1.0.1

5 years ago

1.0.0

5 years ago