{"id":23789954,"url":"https://github.com/blackglory/store-js","last_synced_at":"2026-04-15T14:02:51.209Z","repository":{"id":44808234,"uuid":"317507344","full_name":"BlackGlory/store-js","owner":"BlackGlory","description":"🌲 The JavaScript SDK for Store","archived":false,"fork":false,"pushed_at":"2023-06-11T06:45:01.000Z","size":1399,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-02-04T09:47:53.976Z","etag":null,"topics":["browser","esm","library","nodejs","npm-package","typescript"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/@blackglory/store-js","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}},"created_at":"2020-12-01T10:36:29.000Z","updated_at":"2023-01-30T09:35:00.000Z","dependencies_parsed_at":"2023-02-16T09:00:53.831Z","dependency_job_id":null,"html_url":"https://github.com/BlackGlory/store-js","commit_stats":null,"previous_names":[],"tags_count":72,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BlackGlory%2Fstore-js","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BlackGlory%2Fstore-js/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BlackGlory%2Fstore-js/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BlackGlory%2Fstore-js/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/BlackGlory","download_url":"https://codeload.github.com/BlackGlory/store-js/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240018690,"owners_count":19734872,"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","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":["browser","esm","library","nodejs","npm-package","typescript"],"created_at":"2025-01-01T17:17:47.860Z","updated_at":"2026-04-15T14:02:51.204Z","avatar_url":"https://github.com/BlackGlory.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# store-js\n## Install\n```sh\nnpm install --save @blackglory/store-js\n# or\nyarn add @blackglory/store-js\n```\n\n## API\n### StoreClient\n```ts\ninterface IStoreClientOptions {\n  server: string\n  timeout?: number\n  retryIntervalForReconnection?: number\n}\n\ninterface INamespaceStats {\n  items: number\n}\n\ninterface IItem {\n  value: JSONValue\n  revision: string\n}\n\nclass IncorrectRevision extends CustomError {}\n\nclass StoreClient {\n  static create(options: IStoreClientOptions): Promise\u003cStoreClient\u003e\n\n  close(): Promise\u003cvoid\u003e\n\n  getNamespaceStats(\n    namespace: string\n  , signal?: AbortSignal\n  ): Promise\u003cINamespaceStats\u003e\n\n  getAllNamespaces(signal?: AbortSignal): Promise\u003cstring[]\u003e\n\n  getAllItemIds(namespace: string, signal?: AbortSignal): Promise\u003cstring[]\u003e\n\n  clearItemsByNamespace(namespace: string, signal?: AbortSignal): Promise\u003cvoid\u003e\n\n  hasItem(\n    namespace: string\n  , itemId: string\n  , signal?: AbortSignal\n  ): Promise\u003cboolean\u003e\n\n  getItem(\n    namespace: string\n  , itemId: string\n  , signal?: AbortSignal\n  ): Promise\u003cIItem | null\u003e\n\n  /**\n   * @throws {IncorrectRevision}\n   * 在提供revision参数的情况下, 如果目标项目的revision值不等于参数, 或项目不存在, 则抛出此错误.\n   */\n  setItem(\n    namespace: string\n  , itemId: string\n  , value: JSONValue\n  , revision?: string | null\n  , signal?: AbortSignal\n  ): Promise\u003cstring\u003e\n\n  /**\n   * @throws {IncorrectRevision}\n   * 在提供revision参数的情况下, 如果目标项目的revision值不等于参数, 或项目不存在, 则抛出此错误.\n   */\n  removeItem(\n    namespace: string\n  , itemId: string\n  , revision?: string\n  , signal?: AbortSignal\n  ): Promise\u003cvoid\u003e\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fblackglory%2Fstore-js","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fblackglory%2Fstore-js","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fblackglory%2Fstore-js/lists"}