{"id":46698,"library":"typeorm-in-memory-cache","title":"typeorm-in-memory-cache","description":"Provides an in-memory cache provider for TypeORM, wrapping node-cache. Version 1.0.2 is the latest stable release. This package is a thin wrapper around node-cache, offering simplicity and minimal configuration. It is suitable for development or single-process applications, but lacks distributed cache features found in alternatives like ioredis or redis. No significant release cadence; appears unmaintained since 2020.","status":"maintenance","version":"1.0.2","language":"javascript","source_language":"en","source_url":null,"tags":["javascript","typescript"],"install":[{"cmd":"npm install typeorm-in-memory-cache","lang":"bash","label":"npm"},{"cmd":"yarn add typeorm-in-memory-cache","lang":"bash","label":"yarn"},{"cmd":"pnpm add typeorm-in-memory-cache","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"Peer dependency; required to use the cache provider with TypeORM","package":"typeorm","optional":false}],"imports":[{"note":"Default export; CJS require works but TypeScript may prefer ESM import with default.","wrong":"const InMemoryCacheProvider = require('typeorm-in-memory-cache')","symbol":"InMemoryCacheProvider","correct":"import InMemoryCacheProvider from 'typeorm-in-memory-cache'"},{"note":"Named import also works as the package has a named export alias, but default is more common.","wrong":"import { InMemoryCacheProvider } from 'typeorm-in-memory-cache'","symbol":"InMemoryCacheProvider","correct":"import { InMemoryCacheProvider } from 'typeorm-in-memory-cache'"},{"note":"If customizing node-cache options, import NodeCache separately. The wrapper accepts an optional NodeCache instance.","wrong":"const NodeCache = require('node-cache');","symbol":"NodeCache","correct":"import NodeCache from 'node-cache'"}],"quickstart":{"code":"import InMemoryCacheProvider from 'typeorm-in-memory-cache';\nimport { DataSource } from 'typeorm';\n\nconst AppDataSource = new DataSource({\n  type: 'sqlite',\n  database: ':memory:',\n  entities: [],\n  synchronize: true,\n  cache: {\n    duration: 60000,\n    provider() {\n      return new InMemoryCacheProvider();\n    }\n  }\n});\n\nAppDataSource.initialize().then(() => {\n  console.log('Data Source has been initialized!');\n}).catch((err) => {\n  console.error('Error during Data Source initialization', err);\n});","lang":"typescript","description":"Shows how to configure TypeORM to use the in-memory cache provider with a default node-cache instance."},"warnings":[{"fix":"Consider using typeorm's Redis or ioredis cache provider for distributed setups.","message":"The cache is in-memory and not shared across processes/instances. For clustered or multi-process applications, use a distributed cache like Redis.","severity":"gotcha","affected_versions":">=0.0.0"},{"fix":"Run npm install node-cache if you encounter errors.","message":"The package is a thin wrapper around node-cache; node-cache is not included as a dependency but as a peer dependency? Actually, node-cache is a transitive dependency of typeorm-in-memory-cache, but ensure node-cache is installed.","severity":"gotcha","affected_versions":">=0.0.0"},{"fix":"Check TypeORM version compatibility; use with TypeORM 0.2.x only. For 0.3.x, consider using TypeORM's built-in caching or another cache provider.","message":"The package has not been updated since 2020 and may not be compatible with future TypeORM versions. TypeORM 0.3.x introduced breaking changes in cache API.","severity":"deprecated","affected_versions":">=1.0.0"}],"env_vars":null,"search_vec":"'1.0.2':20 '2020':70 'altern':58 'appear':67 'applic':50 'around':32 'cach':5,11,18,35,54 'cadenc':66 'configur':40 'develop':45 'distribut':53 'featur':55 'found':56 'in-memori':8 'ioredi':60 'javascript':71 'lack':52 'latest':23 'like':59 'memori':4,10 'minim':39 'node':17,34 'node-cach':16,33 'offer':36 'packag':27 'process':49 'provid':6,12 'redi':62 'releas':25,65 'signific':64 'simplic':37 'sinc':69 'singl':48 'single-process':47 'stabl':24 'suitabl':43 'thin':30 'typeorm':2,14 'typeorm-in-memory-cach':1 'typescript':72 'unmaintain':68 'version':19 'wrap':15 'wrapper':31","created_at":"2026-06-07T13:01:11.219635+00:00","updated_at":"2026-06-07T13:01:11.219635+00:00","problems":[{"fix":"Use import statement or set type: 'module' in package.json.","cause":"Using CommonJS require() when package is ESM-only or has default export that is an ES module.","error":"ERR_REQUIRE_ESM: require() of ES Module not supported"},{"fix":"Ensure import statement is correct: import InMemoryCacheProvider from 'typeorm-in-memory-cache';","cause":"Possibly due to incorrect import (e.g., importing named export when only default exists) or module resolution issue.","error":"TypeError: InMemoryCacheProvider is not a constructor"},{"fix":"Run npm install node-cache to explicitly install it.","cause":"node-cache is a dependency of typeorm-in-memory-cache, but may not be installed if npm did not resolve automatically.","error":"Cannot find module 'node-cache'"}],"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":null,"github":null,"docs":null,"changelog":null,"pypi":null,"npm":"typeorm-in-memory-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}}