1.2.0 • Published 6 months ago

typeorm-keyv-cache v1.2.0

Weekly downloads
-
License
MIT
Repository
github
Last release
6 months ago

Typeorm Cache

A typeorm cache provider based on keyv.

Installation

# npm
npm i typeorm-cache keyv --save

# or yarn
yarn add typeorm-cache keyv

Usage

import { createConnection } from 'typeorm'
import { KeyvCacheProvider } from 'typeorm-cache'

// In-memory cache
createConnection({
  // ... db config
  cache: {
    provider() {
      return new KeyvCacheProvider()
    }
  }
})

// Redis
createConnection({
  // ... db config
  cache: {
    provider() {
      return new KeyvCacheProvider('redis://user:pass@localhost:6379')
    }
  }
})

// ...

For more examples, visit keyv documentation.

License

MIT

Copyright (c) 2021, Acathur

1.2.0

6 months ago