{"id":15321807,"url":"https://github.com/eldimious/in-memory-database","last_synced_at":"2026-02-26T05:05:21.581Z","repository":{"id":43869812,"uuid":"458602066","full_name":"eldimious/in-memory-database","owner":"eldimious","description":null,"archived":false,"fork":false,"pushed_at":"2022-02-15T07:45:29.000Z","size":87,"stargazers_count":1,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-10-06T12:42:48.398Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/eldimious.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2022-02-12T18:11:51.000Z","updated_at":"2022-02-14T10:13:41.000Z","dependencies_parsed_at":"2022-09-04T15:32:52.447Z","dependency_job_id":null,"html_url":"https://github.com/eldimious/in-memory-database","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/eldimious/in-memory-database","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eldimious%2Fin-memory-database","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eldimious%2Fin-memory-database/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eldimious%2Fin-memory-database/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eldimious%2Fin-memory-database/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/eldimious","download_url":"https://codeload.github.com/eldimious/in-memory-database/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eldimious%2Fin-memory-database/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29849226,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-25T22:37:40.667Z","status":"online","status_checked_at":"2026-02-26T02:00:06.774Z","response_time":89,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-01T09:13:11.729Z","updated_at":"2026-02-26T05:05:21.548Z","avatar_url":"https://github.com/eldimious.png","language":"TypeScript","funding_links":["https://ko-fi.com/Y8Y797KCA"],"categories":[],"sub_categories":[],"readme":"\u003ch1 align=\"center\"\u003eWelcome to in-memory-database module 👋\u003c/h1\u003e\n\u003cp\u003e\n  \u003ca href=\"https://www.npmjs.com/package/in-memory-database\" target=\"_blank\"\u003e\n    \u003cimg alt=\"Version\" src=\"https://img.shields.io/npm/v/in-memory-database.svg\"\u003e\n  \u003c/a\u003e\n  \u003cimg src=\"https://img.shields.io/badge/npm-%3E%3D7.13.0-blue.svg\" /\u003e\n  \u003ca href=\"https://github.com/eldimious/in-memory-database#readme\" target=\"_blank\"\u003e\n    \u003cimg alt=\"Documentation\" src=\"https://img.shields.io/badge/documentation-yes-brightgreen.svg\" /\u003e\n  \u003c/a\u003e\n  \u003ca href=\"https://github.com/eldimious/in-memory-database/graphs/commit-activity\" target=\"_blank\"\u003e\n    \u003cimg alt=\"Maintenance\" src=\"https://img.shields.io/badge/Maintained%3F-yes-green.svg\" /\u003e\n  \u003c/a\u003e\n\n  \u003ca href=\"https://twitter.com/el_dimious\" target=\"_blank\"\u003e\n    \u003cimg alt=\"Twitter: el_dimious\" src=\"https://img.shields.io/twitter/follow/el_dimious.svg?style=social\" /\u003e\n  \u003c/a\u003e\n\u003c/p\u003e\n\n\u003e Simple caching module that works a like memcached. All keys are stored in a single object.\n\n## Install\n\n```sh\nnpm install --save in-memory-database\n```\n\n## Usage\n\n```ts\nconst { InMemoryDatabase } = require('in-memory-database');\n\nconst client = new InMemoryDatabase();\nclient.set('key', 'value');\nclient.get('key');\n```\n\n## Docs\n### `class InMemoryDatabase()`\n\n**Class Methods**\n\nThese functions are specified in the in-memory-database.\n\n\u003e `get(key: string): any`\n\nGets a key'svalue.\n```ts\nclient.get('key');\n```\n\n\u003e `set(key: string, value: any): void`\n\nSets a key to value.\n```ts\nclient.set('key', 'value');\n```\n\n\u003e `delete(key: string): void`\n\nDeletes a key.\n\n```ts\nclient.delete('key');\n```\n\n\u003e `mget(keys: string[]): any`\n\nLists all of the keys that defined in the array.\n\n```ts\nconst values = client.mget(['key1', 'key2']);\n```\n\n\u003e `mset(keyValueMap: Map\u003cstring, any\u003e): void`\n\nSets the multiple a keys/values.\n\n```ts\nconst keyValueMap: Map\u003cstring, any\u003e = new Map();\nkeyValueMap.set('key1', 'value1');\nkeyValueMap.set('key2', {'foo': 'bar', 'baz': 1});\nclient.mset(keyValueMap);\n```\n\n\u003e `keys(): string[]`\n\nGet all database keys.\n\n```ts\nconst keys = client.keys();\n```\n\n\u003e `has(key: string): boolean`\n\nDefines if we have stored specific key in database.\n\n```ts\nconst isAlreadyThere = client.has('key');\n```\n\n\u003e `flush(): void`\n\nFlush database.\n\n```ts\nclient.flush();\n```\n\n## Run tests\n\n```sh\nnpm run test\n```\n\n## Author\n\n👤 **Dimos Botsaris**\n\n* Website: https://www.eldimious.com\n* Twitter: [@el_dimious](https://twitter.com/el_dimious)\n* Github: [@eldimious](https://github.com/eldimious)\n* LinkedIn: [@dimosthenis-botsaris-5ab16485](https://www.linkedin.com/in/dimosthenis-botsaris-5ab16485/)\n\n## Support Me\n\n[![ko-fi](https://ko-fi.com/img/githubbutton_sm.svg)](https://ko-fi.com/Y8Y797KCA)\n\n## Show your support\n\nGive a ⭐️ if this project helped you!\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Feldimious%2Fin-memory-database","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Feldimious%2Fin-memory-database","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Feldimious%2Fin-memory-database/lists"}