{"_id":"@apihub24/in-memory-repository","_rev":"4-603dc013e686f8ab4b73ebf8ad23cf88","name":"@apihub24/in-memory-repository","dist-tags":{"latest":"2.0.0-alpha.0"},"versions":{"1.0.0":{"name":"@apihub24/in-memory-repository","version":"1.0.0","keywords":[],"author":{"url":"https://git.apihub24.de/","name":"Markus Morgenstern","email":"markusmorgenstern87@outlook.de"},"license":"MIT","_id":"@apihub24/in-memory-repository@1.0.0","maintainers":[{"name":"apihub24","email":"markusmorgenstern87@outlook.de"}],"dist":{"shasum":"72618a651fa714a9f19598171385539b4f7d4db2","tarball":"https://registry.npmjs.org/@apihub24/in-memory-repository/-/in-memory-repository-1.0.0.tgz","fileCount":9,"integrity":"sha512-xERelZeSMZiSadIwORFVL9cGs36DB43i4b0ok9zUESUDmHHDRz7iqdtKCQfu3ELvXNHv3Pw7hKrWfRQ3TPj+8Q==","signatures":[{"sig":"MEQCIH3Nq6ee/7zMSBLR2BpFGAmJLqYYvwtC+XTjmhSFy+MrAiAAj+jR32WcqiCnsdI4YZG7iMlqtFy1EXJipHtiy50Row==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":17916},"main":"dist/index.js","types":"./dist/index.d.ts","gitHead":"08fd76dcefb881ae293a840c00483f12e5ce2f93","scripts":{"build":"tsc"},"_npmUser":{"name":"apihub24","email":"markusmorgenstern87@outlook.de"},"_npmVersion":"10.9.3","description":"","directories":{},"_nodeVersion":"22.18.0","dependencies":{"@apihub24/repository":"^1.0.1"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"typescript":"^5.9.2"},"_npmOperationalInternal":{"tmp":"tmp/in-memory-repository_1.0.0_1755719603983_0.3485177998843463","host":"s3://npm-registry-packages-npm-production"}},"1.0.1":{"name":"@apihub24/in-memory-repository","version":"1.0.1","keywords":[],"author":{"url":"https://git.apihub24.de/","name":"Markus Morgenstern","email":"markusmorgenstern87@outlook.de"},"license":"MIT","_id":"@apihub24/in-memory-repository@1.0.1","maintainers":[{"name":"apihub24","email":"markusmorgenstern87@outlook.de"}],"dist":{"shasum":"2abebf0b9219490f9972045a7f97c04c7186d464","tarball":"https://registry.npmjs.org/@apihub24/in-memory-repository/-/in-memory-repository-1.0.1.tgz","fileCount":10,"integrity":"sha512-rQ0X8xHKaSYelLFbSMLEeddPZqqqVOWN8A8Qnr1udEQ1aX4Lqau5TlFCpdtLz0XAQh4XA9tJRW96MC/Sor1bag==","signatures":[{"sig":"MEUCIQD1uvtUKtujwS21lTrkOn4XTEpMuEZtE0u3kDvvG4ig0AIgbnmDWYl4r0f1D3I4uJJV1NxrTMgTA6OqbShEB9qFzNc=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":19224},"main":"dist/index.js","types":"./dist/index.d.ts","gitHead":"f94e266d4a6bf51099aea66bf8fc6ffc97e57d43","scripts":{"build":"tsc"},"_npmUser":{"name":"apihub24","email":"markusmorgenstern87@outlook.de"},"_npmVersion":"10.9.3","description":"Implementation of the [@apihub24/repository](https://www.npmjs.com/package/@apihub24/repository) to store the Objects in Memory.","directories":{},"_nodeVersion":"22.18.0","dependencies":{"@apihub24/repository":"^1.0.2"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"typescript":"^5.9.2"},"_npmOperationalInternal":{"tmp":"tmp/in-memory-repository_1.0.1_1755772095559_0.536282037720808","host":"s3://npm-registry-packages-npm-production"}},"1.0.2":{"name":"@apihub24/in-memory-repository","version":"1.0.2","keywords":[],"author":{"url":"https://git.apihub24.de/","name":"Markus Morgenstern","email":"markusmorgenstern87@outlook.de"},"license":"MIT","_id":"@apihub24/in-memory-repository@1.0.2","maintainers":[{"name":"apihub24","email":"markusmorgenstern87@outlook.de"}],"dist":{"shasum":"7685d1ae8465a7b09fa371607c06a81182fb88c0","tarball":"https://registry.npmjs.org/@apihub24/in-memory-repository/-/in-memory-repository-1.0.2.tgz","fileCount":10,"integrity":"sha512-5xGbPtHWhV2z7Y6NUcFYPDELWFPLYrvXoBVH3oVIqWnx+7vQ9jywcCYqfsxIzb9WOsYlncw5ZZM6PJBp8xb6HA==","signatures":[{"sig":"MEUCIQDlU9569Uc2H/oPdvY51GUIcHAIGHBvWjIHWPjdbLWUvwIgGozcx4iSSJtS2ZVmfOJK4EAmgKJl34Su2y4gG8d3oHU=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":81411},"jest":{"roots":["<rootDir>/src/"],"rootDir":".","testRegex":".*\\.spec\\.ts$","transform":{"^.+\\.(t|j)s$":"ts-jest"},"testEnvironment":"node","moduleNameMapper":{},"coverageDirectory":"./coverage","collectCoverageFrom":["**/*.(t|j)s"],"moduleFileExtensions":["js","json","ts"]},"main":"dist/index.js","types":"./dist/index.d.ts","gitHead":"f94e266d4a6bf51099aea66bf8fc6ffc97e57d43","scripts":{"pub":"npm publish","rel":"npm i && npm run build && npm run test:coverage","test":"jest","build":"rimraf ./dist && tsc","test:coverage":"jest --coverage"},"_npmUser":{"name":"apihub24","email":"markusmorgenstern87@outlook.de"},"_npmVersion":"10.9.3","description":"Implementation of the [@apihub24/repository](https://www.npmjs.com/package/@apihub24/repository) to store the Objects in Memory.","directories":{},"_nodeVersion":"22.18.0","dependencies":{"@apihub24/repository":"^1.0.3"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^30.0.0","rimraf":"^6.0.1","ts-jest":"^29.4.1","typescript":"^5.9.2","@types/jest":"^30.0.0","@nestjs/testing":"^11.1.6"},"_npmOperationalInternal":{"tmp":"tmp/in-memory-repository_1.0.2_1755809814255_0.45663515417510747","host":"s3://npm-registry-packages-npm-production"}},"2.0.0-alpha.0":{"name":"@apihub24/in-memory-repository","version":"2.0.0-alpha.0","description":"Implementation of the [@apihub24/repository](https://www.npmjs.com/package/@apihub24/repository) to store the Objects in Memory.","main":"dist/index.js","types":"./dist/index.d.ts","scripts":{"build":"rimraf ./dist && tsc","test":"jest","test:coverage":"jest --coverage","pub":"npm publish","rel":"npm i && npm run build && npm run test:coverage"},"dependencies":{"@apihub24/repository":"2.0.0-alpha.0"},"devDependencies":{"rimraf":"^6.0.1","@nestjs/testing":"^11.1.6","typescript":"^5.9.2","@types/jest":"^30.0.0","jest":"^30.0.0","ts-jest":"^29.4.1"},"keywords":[],"author":{"name":"Markus Morgenstern","email":"markusmorgenstern87@outlook.de","url":"https://git.apihub24.de/"},"license":"MIT","publishConfig":{"access":"public"},"jest":{"moduleFileExtensions":["js","json","ts"],"rootDir":".","testRegex":".*\\.spec\\.ts$","transform":{"^.+\\.(t|j)s$":"ts-jest"},"collectCoverageFrom":["**/*.(t|j)s"],"coverageDirectory":"./coverage","testEnvironment":"node","roots":["<rootDir>/src/"],"moduleNameMapper":{}},"_id":"@apihub24/in-memory-repository@2.0.0-alpha.0","gitHead":"475dec84659ef16d5f7abab29853abd059f1e339","_nodeVersion":"22.18.0","_npmVersion":"10.9.3","dist":{"integrity":"sha512-hXky/fLesmGqcFRruEh3NLX4VpPmf6j9a3QXR3nr/Msbo8MVFTl/+0/ZzWXna0RbHOtXmrscKuPmn4hIq58TlA==","shasum":"88a2a78a2e0c415ec3ce330a2676236b99c80cf4","tarball":"https://registry.npmjs.org/@apihub24/in-memory-repository/-/in-memory-repository-2.0.0-alpha.0.tgz","fileCount":10,"unpackedSize":82866,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIQCvkNlYJmUWny5DgBuX5otjz97gxD/TRh6jolUqVhmdRwIgD9xsDDzN7LgvtiyUlwNMejQn26hbKY1cN7Yp90I9VMw="}]},"_npmUser":{"name":"apihub24","email":"markusmorgenstern87@outlook.de"},"directories":{},"maintainers":[{"name":"apihub24","email":"markusmorgenstern87@outlook.de"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/in-memory-repository_2.0.0-alpha.0_1756073087904_0.3578980057876342"},"_hasShrinkwrap":false}},"time":{"created":"2025-08-20T19:53:23.880Z","modified":"2025-08-24T22:04:48.333Z","1.0.0":"2025-08-20T19:53:24.169Z","1.0.1":"2025-08-21T10:28:15.758Z","1.0.2":"2025-08-21T20:56:54.451Z","2.0.0-alpha.0":"2025-08-24T22:04:48.139Z"},"author":{"name":"Markus Morgenstern","email":"markusmorgenstern87@outlook.de","url":"https://git.apihub24.de/"},"license":"MIT","keywords":[],"description":"Implementation of the [@apihub24/repository](https://www.npmjs.com/package/@apihub24/repository) to store the Objects in Memory.","maintainers":[{"name":"apihub24","email":"markusmorgenstern87@outlook.de"}],"readme":"# InMemory Repository\r\n\r\nImplementation of the [@apihub24/repository](https://www.npmjs.com/package/@apihub24/repository) to store the Objects in Memory.\r\n\r\n## Install\r\n\r\n```bash\r\nnpm i --save @apihub24/in-memory-repository\r\n```\r\n\r\n## Usage\r\n\r\n```typescript\r\nimport { InMemoryRepository } from '@apihub24/in-memory-repository';\r\n\r\nclass TestModel {\r\n  id: string;\r\n  name: string;\r\n  age: number;\r\n}\r\n\r\nasync function run() {\r\n  const repo = new InMemoryRepository<TestModel>();\r\n\r\n  // writes {id:\"1\",name:\"Test\",age:28} into console\r\n  console.info(await repo.save({\r\n    id: '1',\r\n    name: 'Test'\r\n    age: 28,\r\n  }));\r\n\r\n  // writes [{id:\"1\",name:\"Test\",age:28}] into console\r\n  console.info(await repo.getBy(x => x.name === 'Test'));\r\n\r\n  // writes true into console\r\n  console.info(await repo.deleteBy(x => x.name === 'Test'));\r\n}\r\nrun();\r\n```\r\n\r\nor use it in nestjs with dependency injection\r\n\r\n```typescript\r\n...\r\n{\r\n  provide: '@apihub24/organization_repository',\r\n  useClass: InMemoryRepository<IOrganization>,\r\n},\r\n{\r\n  provide: '@apihub24/account_repository',\r\n  useClass: InMemoryRepository<IAccount>,\r\n},\r\n{\r\n  provide: '@apihub24/group_repository',\r\n  useClass: InMemoryRepository<IGroup>,\r\n},\r\n{\r\n  provide: '@apihub24/right_repository',\r\n  useClass: InMemoryRepository<IRight>,\r\n},\r\n```\r\n","readmeFilename":"README.md"}