typeorm-in-memory-cache
v1.0.2
Published
Provides an in-memory cache for typeorm
Downloads
6,061
Readme
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)
}
}
}