{"id":16979204,"url":"https://github.com/max9159/keyvaluestore","last_synced_at":"2026-05-18T04:04:00.987Z","repository":{"id":122960367,"uuid":"518915305","full_name":"max9159/keyValueStore","owner":"max9159","description":"The KeyValueStore is a key-value in-memory store service with cache mechanism written in NodeJS programming language.","archived":false,"fork":false,"pushed_at":"2022-07-28T16:31:09.000Z","size":15,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-08-27T02:48:09.882Z","etag":null,"topics":["cache","cache-service","fifo","lock","nodejs"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/max9159.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-07-28T16:17:03.000Z","updated_at":"2025-01-09T07:58:11.000Z","dependencies_parsed_at":"2024-06-09T00:00:56.086Z","dependency_job_id":null,"html_url":"https://github.com/max9159/keyValueStore","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/max9159/keyValueStore","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/max9159%2FkeyValueStore","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/max9159%2FkeyValueStore/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/max9159%2FkeyValueStore/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/max9159%2FkeyValueStore/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/max9159","download_url":"https://codeload.github.com/max9159/keyValueStore/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/max9159%2FkeyValueStore/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279005915,"owners_count":26083982,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-10T02:00:06.843Z","response_time":62,"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":["cache","cache-service","fifo","lock","nodejs"],"created_at":"2024-10-14T01:45:08.790Z","updated_at":"2025-10-11T01:06:23.537Z","avatar_url":"https://github.com/max9159.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# KeyValueStore\n\u003e The **KeyValueStore** is a key-value in-memory store service with cache mechanism written in NodeJS programming language. \n\n\u003e It including a fake store service getting data from DataBase (Mock data would be generated in-memory) and cache mechanism to practice any design-patten.\n\n\u003e Currently, it supports the thread-safe with Locks and cache replacement policy FIFO (Also flexible to change policy by injection).\n\n\n## Installation\n- Ensure you have install NodeJS.\n  - https://nodejs.org/en/download/\n```bash\nnpm install\n```\n\n## Getting Started\n- To start **KeyValueStore** API service.\n```bash\nnpm start\n```\n\n## API Request Example\n```console\n## GET\ncurl --location --request GET \"http://localhost:3000/api/store?key=3\"\n\n## POST\ncurl --location --request POST \"http://localhost:3000/api/store\" --header \"Content-Type: application/json\" --data-raw \"{ \\\"key\\\": \\\"3\\\", \\\"value\\\": \\\"value3\\\"}\"\n\n```\n## Unit-Tests\n- Run testing command.\n```bash\nnpm run test\n```\n- All of test cases in [keyValueStore.test](./test/keyValueStore.test.js)\n\n## API-Tests\n  - [integrationTests.http](./test/integrationTests.http)\n  - Use above http file via plugin can send HTTP request such as [HTTP Client of IntelliJ](https://www.jetbrains.com/help/idea/http-client-in-product-code-editor.html) or [REST Client of VSCode Extension](https://marketplace.visualstudio.com/items?itemName=humao.rest-client)\n\n## Configuration\n- [cacheConfigs](./config/cacheConfigs.js)\n  - Can setup cache service's **MAXIMUM_BYTES_SIZE** and **REPLACEMENT_POLICY**\n  - Currently supports **FIFO**, can add new strategy and implement the same as interface of [fifoStrategy.js](./service/fifoStrategy.js)\n\n## Lock in NodeJS\n- To prevent race condition the **KeyValueStore** implement lock mechanism in [Locker](./util/locker.js)\n\n## Mock Data\n- Mock data has been generated in the constructor of the [storeService](./service/storeService.js).\n- The [storeService](./service/storeService.js) to pretend to be a DataBase store service.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmax9159%2Fkeyvaluestore","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmax9159%2Fkeyvaluestore","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmax9159%2Fkeyvaluestore/lists"}