{"id":46697,"library":"typeorm-cache","title":"TypeORM Cache Provider (Keyv)","description":"A TypeORM cache provider backed by keyv, enabling pluggable cache storage (memory, Redis, MongoDB, etc.) for TypeORM v0.2.x. Version 1.1.3 is the latest stable release; the package is mature with no frequent updates. Unlike built-in TypeORM cache (only supports redis or ioredis), this library leverages keyv's adapter ecosystem, supporting multiple backends with a unified API. Ships TypeScript definitions and requires keyv v4 and TypeORM v0.2 as peer dependencies.","status":"maintenance","version":"1.1.3","language":"javascript","source_language":"en","source_url":"https://github.com/acathur/typeorm-cache","tags":["javascript","typeorm","cache","keyv","memory","typescript"],"install":[{"cmd":"npm install typeorm-cache","lang":"bash","label":"npm"},{"cmd":"yarn add typeorm-cache","lang":"bash","label":"yarn"},{"cmd":"pnpm add typeorm-cache","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"Peer dependency; core caching backend","package":"keyv","optional":false},{"reason":"Peer dependency; the ORM requiring cache provider","package":"typeorm","optional":false}],"imports":[{"note":"Named export, ESM-style import recommended. Package supports CommonJS require but returns { KeyvCacheProvider }.","wrong":"const KeyvCacheProvider = require('typeorm-cache')","symbol":"KeyvCacheProvider","correct":"import { KeyvCacheProvider } from 'typeorm-cache'"},{"note":"Default import does not exist; must use named import.","wrong":"import KeyvCacheProvider from 'typeorm-cache'","symbol":"KeyvCacheProvider","correct":"import { KeyvCacheProvider } from 'typeorm-cache'"},{"note":"Not from this package; shown for context.","wrong":"","symbol":"createConnection","correct":"import { createConnection } from 'typeorm'"}],"quickstart":{"code":"import { createConnection } from 'typeorm'\nimport { KeyvCacheProvider } from 'typeorm-cache'\n\ncreateConnection({\n  type: 'postgres',\n  host: process.env.DB_HOST ?? 'localhost',\n  port: Number(process.env.DB_PORT) || 5432,\n  username: process.env.DB_USER ?? 'test',\n  password: process.env.DB_PASS ?? '',\n  database: process.env.DB_NAME ?? 'test',\n  entities: [/* your entities */],\n  cache: {\n    provider() {\n      return new KeyvCacheProvider(process.env.REDIS_URL ?? '')\n    }\n  }\n}).then(() => console.log('Connected with cache'))","lang":"typescript","description":"Basic TypeORM connection using KeyvCacheProvider with optional Redis URL from environment variable."},"warnings":[{"fix":"Ensure keyv@4 and typeorm@~0.2.x are installed. Not compatible with TypeORM v0.3+.","message":"KeyvCacheProvider requires keyv v4 and typeorm >=0.2.0 but <0.3.0","severity":"breaking","affected_versions":">=1.0.0"},{"fix":"Provide a URI like 'redis://...' for persistent caching.","message":"Calling new KeyvCacheProvider() with no URI defaults to in-memory store; no data persistence across restarts","severity":"gotcha","affected_versions":">=1.0.0"},{"fix":"Consider switching to TypeORM's built-in cache or an alternative if using TypeORM 0.3+.","message":"Package last updated in 2021; no explicit deprecation but TypeORM v0.3 has breaking API changes","severity":"deprecated","affected_versions":">=1.1.0"}],"env_vars":null,"search_vec":"'1.1.3':24 'adapt':54 'api':62 'back':9 'backend':58 'built':40 'built-in':39 'cach':2,7,14,43,78 'definit':65 'depend':75 'ecosystem':55 'enabl':12 'etc':19 'frequent':36 'ioredi':48 'javascript':76 'keyv':4,11,52,68,79 'latest':27 'leverag':51 'librari':50 'matur':33 'memori':16,80 'mongodb':18 'multipl':57 'packag':31 'peer':74 'pluggabl':13 'provid':3,8 'redi':17,46 'releas':29 'requir':67 'ship':63 'stabl':28 'storag':15 'support':45,56 'typeorm':1,6,21,42,71,77 'typescript':64,81 'unifi':61 'unlik':38 'updat':37 'v0.2':72 'v0.2.x':22 'v4':69 'version':23","created_at":"2026-06-07T13:01:11.092479+00:00","updated_at":"2026-06-07T13:01:11.092479+00:00","problems":[{"fix":"Install compatible keyv: npm install keyv@4","cause":"Missing peer dependency keyv or incompatible version","error":"TypeError: Class extends value undefined is not a constructor or null"},{"fix":"Use new KeyvCacheProvider(undefined) or new KeyvCacheProvider() for default memory store","cause":"Passing a boolean/undefined as constructor argument","error":"DataError: keyvURI must be a string or an object"}],"ecosystem":"npm","meta_description":null,"install_score":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":null,"cli_name":null,"cli_version":null,"type":"library","homepage":"https://github.com/acathur/typeorm-cache#readme","github":"https://github.com/acathur/typeorm-cache","docs":null,"changelog":null,"pypi":null,"npm":"typeorm-cache","openapi_spec":null,"status_page":null,"smithery":null,"categories":["database"],"base_url":null,"auth_type":null,"provenance":{"verified_status":null,"verified_at":null,"last_verified":"2026-06-07","next_check":"2026-09-05","install_tag":null}}