{"id":23790023,"url":"https://github.com/blackglory/store","last_synced_at":"2026-03-07T07:31:05.792Z","repository":{"id":44945463,"uuid":"312647115","full_name":"BlackGlory/store","owner":"BlackGlory","description":"🌳","archived":false,"fork":false,"pushed_at":"2025-11-21T07:10:52.000Z","size":2171,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-11-21T09:08:56.482Z","etag":null,"topics":["docker-image","esm","microservice","nodejs","typescript"],"latest_commit_sha":null,"homepage":"https://hub.docker.com/r/blackglory/store","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/BlackGlory.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","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,"zenodo":null}},"created_at":"2020-11-13T17:54:11.000Z","updated_at":"2025-11-21T07:10:55.000Z","dependencies_parsed_at":"2025-07-07T19:37:22.977Z","dependency_job_id":"c214142d-e1e7-4432-b8a6-1c8ec39f3621","html_url":"https://github.com/BlackGlory/store","commit_stats":null,"previous_names":[],"tags_count":23,"template":false,"template_full_name":null,"purl":"pkg:github/BlackGlory/store","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BlackGlory%2Fstore","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BlackGlory%2Fstore/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BlackGlory%2Fstore/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BlackGlory%2Fstore/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/BlackGlory","download_url":"https://codeload.github.com/BlackGlory/store/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BlackGlory%2Fstore/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30209719,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-07T05:23:27.321Z","status":"ssl_error","status_checked_at":"2026-03-07T05:00:17.256Z","response_time":53,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["docker-image","esm","microservice","nodejs","typescript"],"created_at":"2025-01-01T17:18:08.215Z","updated_at":"2026-03-07T07:31:05.787Z","avatar_url":"https://github.com/BlackGlory.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Store\n提供以WebSocket为通讯协议的键值对数据库, 受到[CouchDB]启发.\n\n[CouchDB]: https://couchdb.apache.org]\n\n## Quickstart\n```sh\ndocker run \\\n  --detach \\\n  --publish 8080:8080 \\\n  blackglory/store\n```\n\n## Install\n### 从源代码运行\n```sh\ngit clone https://github.com/BlackGlory/store\ncd store\nyarn install\nyarn build\nyarn bundle\nyarn --silent start\n```\n\n### 从源代码构建\n```sh\ngit clone https://github.com/BlackGlory/store\ncd store\nyarn install\nyarn docker:build\n```\n\n### Recipes\n#### docker-compose.yml\n```yaml\nversion: '3.8'\n\nservices:\n  store:\n    image: 'blackglory/store'\n    restart: always\n    volumes:\n      - 'store-data:/data'\n    ports:\n      - '8080:8080'\n\nvolumes:\n  store-data:\n```\n\n## API\n```ts\ninterface INamespaceStats {\n  items: number\n}\n\ninterface IItem {\n  value: JSONValue\n  revision: string\n}\n\ninterface IAPI {\n  getAllNamespaces(): string[]\n  getAllItemIds(namespace: string): string[]\n\n  getNamespaceStats(namespace: string): INamespaceStats\n\n  clearItemsByNamespace(namespace: string): null\n\n  hasItem(namespace: string, itemId: string): boolean\n  getItem(namespace: string, itemId: string): IItem | null\n\n  /**\n   * @param revision\n   * 可选参数, 用于实现乐观并发策略.\n   * `null`表示目标项目不存在.\n   * \n   * @throws {IncorrectRevision}\n   * 在提供revision参数的情况下, 如果目标项目的revision值不等于参数, 或项目不存在, 则抛出此错误.\n   * \n   * @returns 如果成功, 返回新的revision.\n   */\n  setItem(\n    namespace: string\n  , itemId: string\n  , value: JSONValue\n  , revision?: string | null\n  ): string\n\n  /**\n   * @param revision 可选参数, 用于实现乐观并发策略.\n   * @throws {IncorrectRevision}\n   * 在提供revision参数的情况下, 如果目标项目的revision值不等于参数, 或项目不存在, 则抛出此错误.\n   */\n  removeItem(namespace: string, itemId: string, revision?: string): null\n}\n\nclass IncorrectRevision extends CustomError {}\n```\n\n## 环境变量\n### `STORE_HOST`, `STORE_PORT`\n通过环境变量`STORE_HOST`和`STORE_PORT`决定服务器监听的地址和端口,\n默认值为`localhost`和`8080`.\n\n### `STORE_WS_HEARTBEAT_INTERVAL`\n通过环境变量`STORE_WS_HEARTBEAT_INTERVAL`可以设置WS心跳包(ping帧)的发送间隔, 单位为毫秒.\n在默认情况下, 服务不会发送心跳包,\n半开连接的检测依赖于服务端和客户端的运行平台的TCP Keepalive配置.\n\n当`STORE_WS_HEARTBEAT_INTERVAL`大于零时,\n服务会通过WS的ping帧按间隔发送心跳包.\n\n## 客户端\n- JavaScript/TypeScript(Node.js, Browser): \u003chttps://github.com/BlackGlory/store-js\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fblackglory%2Fstore","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fblackglory%2Fstore","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fblackglory%2Fstore/lists"}