{"id":23790044,"url":"https://github.com/blackglory/estore","last_synced_at":"2026-04-30T11:35:28.975Z","repository":{"id":82412752,"uuid":"456043616","full_name":"BlackGlory/estore","owner":"BlackGlory","description":"🌲","archived":false,"fork":false,"pushed_at":"2026-03-14T08:45:18.000Z","size":2103,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2026-03-14T19:06:12.126Z","etag":null,"topics":["docker-image","esm","microservice","nodejs","typescript"],"latest_commit_sha":null,"homepage":"https://hub.docker.com/r/blackglory/estore","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,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2022-02-06T03:10:52.000Z","updated_at":"2026-03-14T08:45:22.000Z","dependencies_parsed_at":"2025-02-21T12:43:27.580Z","dependency_job_id":"3b3f6095-1e90-486e-b117-c71400b46d01","html_url":"https://github.com/BlackGlory/estore","commit_stats":null,"previous_names":[],"tags_count":14,"template":false,"template_full_name":null,"purl":"pkg:github/BlackGlory/estore","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BlackGlory%2Festore","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BlackGlory%2Festore/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BlackGlory%2Festore/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BlackGlory%2Festore/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/BlackGlory","download_url":"https://codeload.github.com/BlackGlory/estore/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BlackGlory%2Festore/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32463892,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-29T22:27:22.272Z","status":"online","status_checked_at":"2026-04-30T02:00:05.929Z","response_time":57,"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":["docker-image","esm","microservice","nodejs","typescript"],"created_at":"2025-01-01T17:18:12.866Z","updated_at":"2026-04-30T11:35:23.963Z","avatar_url":"https://github.com/BlackGlory.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# EStore\n提供以WebSocket为通讯协议的Event Store服务.\n\n## Quickstart\n```sh\ndocker run \\\n  --detach \\\n  --publish 8080:8080 \\\n  blackglory/estore\n```\n\n## Install\n### 从源代码运行\n```sh\ngit clone https://github.com/BlackGlory/estore\ncd estore\nyarn install\nyarn build\nyarn bundle\nyarn --silent start\n```\n\n### 从源代码构建\n```sh\ngit clone https://github.com/BlackGlory/estore\ncd estore\nyarn install\nyarn docker:build\n```\n\n### Recipes\n#### docker-compose.yml\n```yaml\nversion: '3.8'\n\nservices:\n  estore:\n    image: 'blackglory/estore'\n    restart: always\n    volumes:\n      - 'estore-data:/data'\n    ports:\n      - '8080:8080'\n\nvolumes:\n  estore-data:\n```\n\n## API\n```ts\ninterface INamespaceStats {\n  items: number\n}\n\ninterface IAPI {\n  getAllNamespaces(): string[]\n  getAllItemIds(namespace: string): string[]\n  getAllEvents(namespace: string, itemId: string): JSONValue[]\n\n  getNamespaceStats(namespace: string): INamespaceStats\n\n  clearItemsByNamespace(namespace: string): null\n\n  removeItem(namespace: string, itemId: string): null\n\n  /**\n   * 获得指定项目内包含的事件数量, 该值等同于下一个事件插入时的索引号.\n   * 对于不存在的项目, 它会返回0.\n   */\n  getItemSize(namespace: string, itemId: string): number\n\n  /**\n   * @param nextEventIndex 如果指定, 则会在eventIndex不等于下一个index时抛出EventIndexConflict错误.\n   * @throws {EventIndexConflict}\n   */\n  appendEvent(\n    namespace: string\n  , itemId: string\n  , event: JSONValue\n  , nextEventIndex?: number\n  ): null\n\n  getEvent(\n    namespace: string\n  , itemId: string\n  , eventIndex: number\n  ): JSONValue | null\n}\n\nclass EventIndexConflict extends CustomError {}\n```\n\n## 环境变量\n### `ESTORE_HOST`, `ESTORE_PORT`\n通过环境变量`ESTORE_HOST`和`ESTORE_PORT`决定服务器监听的地址和端口,\n默认值为`localhost`和`8080`.\n\n### `ESTORE_WS_HEARTBEAT_INTERVAL`\n通过环境变量`ESTORE_WS_HEARTBEAT_INTERVAL`可以设置WS心跳包(ping帧)的发送间隔, 单位为毫秒.\n在默认情况下, 服务不会发送心跳包,\n半开连接的检测依赖于服务端和客户端的运行平台的TCP Keepalive配置.\n\n当`ESTORE_WS_HEARTBEAT_INTERVAL`大于零时,\n服务会通过WS的ping帧按间隔发送心跳包.\n\n## 客户端\n- JavaScript/TypeScript(Node.js, Browser): \u003chttps://github.com/BlackGlory/estore-js\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fblackglory%2Festore","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fblackglory%2Festore","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fblackglory%2Festore/lists"}