{"id":20109843,"url":"https://github.com/hyper63/hyper-ext-counter","last_synced_at":"2025-03-02T18:24:53.517Z","repository":{"id":44734789,"uuid":"451887110","full_name":"hyper63/hyper-ext-counter","owner":"hyper63","description":"A counter extension for hyper connect that increments a count object in hyper-cache","archived":false,"fork":false,"pushed_at":"2022-01-27T22:40:00.000Z","size":107,"stargazers_count":1,"open_issues_count":1,"forks_count":0,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-01-13T05:41:39.368Z","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/hyper63.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2022-01-25T13:25:09.000Z","updated_at":"2022-01-28T15:44:15.000Z","dependencies_parsed_at":"2022-08-20T12:31:22.084Z","dependency_job_id":null,"html_url":"https://github.com/hyper63/hyper-ext-counter","commit_stats":null,"previous_names":[],"tags_count":8,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hyper63%2Fhyper-ext-counter","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hyper63%2Fhyper-ext-counter/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hyper63%2Fhyper-ext-counter/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hyper63%2Fhyper-ext-counter/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/hyper63","download_url":"https://codeload.github.com/hyper63/hyper-ext-counter/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241550078,"owners_count":19980645,"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":[],"created_at":"2024-11-13T18:09:36.804Z","updated_at":"2025-03-02T18:24:53.483Z","avatar_url":"https://github.com/hyper63.png","language":"TypeScript","readme":"\u003ch1 align=\"center\"\u003e⚡️ hyper-ext-counter ⚡️\u003c/h1\u003e\n\u003cp align=\"center\"\u003eA hyper-connect extension that increments a counter object in the hyper cache\u003c/p\u003e\n\n---\n\n## Table of Contents\n\n- [Install](#install)\n- [Usage](#usage)\n- [API](#api)\n- [CODE OF CONDUCT](#code-of-conduct)\n- [LICENSE](#license)\n- [CONTRIBUTING](#contributing)\n- [ABOUT](#about)\n\n---\n\n## Install\n\n### NodeJS\n\n```sh\nnpm install hyper-connect\nnpm install hyper-ext-counter\n```\n\n## Deno (using import-map)\n\n```json\n{\n  \"imports\": {\n    \"hyper-connect\": \"https://x.nest.land/hyper-connect@VERSION/deno/mod.ts\",\n    \"hyper-ext-counter\": \"https://x.nest.land/hyper-ext-counter@VERSION/deno/mod.ts\"\n  }\n}\n```\n\n```sh\ndeno cache --import-map import_map.json mod.ts\n```\n\n---\n\n## Usage\n\n```js\nimport { connect } from 'hyper-connect'\nimport { counter } from 'hyper-ext-counter'\n\n// create HYPER=[connection string] env variable\nconst hyper = counter(connect(process.env.HYPER))\n\n// increment counter\nconsole.log(await hyper.ext.counter.inc('count'))\n// get current count\nconsole.log(await hyper.ext.counter.get('count'))\n// decrement counter\nconsole.log(await hyper.ext.counter.dec('count'))\n// reset to zero\nconsole.log(await hyper.ext.counter.reset('count'))\n```\n\n\n## API\n\n\u003e All functions are promises and take a single argument of string and return Promise\u003cNumber\u003e | Promise\u003cError\u003e\n\u003e\n\u003e (key: string) =\u003e Promise\u003cNumber\u003e | Promise\u003cError\u003e\n\n| command | description | example |\n| ------- | ----------- | ------- |\n| inc     | increments counter key | `hyper.ext.counter.inc(/* key */ 'count')` |\n| dec     | decrements counter key | `hyper.ext.counter.dec(/* key */ 'count')`  |\n| get     | reads and returns current count | `hyper.ext.counter.get(/* key */ 'count' )` |\n| reset   | resets counter to zero | `hyper.ext.counter.get(/* key */ 'count')` |\n\n\n## Code of Conduct\n\nSEE [CODE_OF_CONDUCT](/CODE_OF_CONDUCT)\n\n## License\n\nSEE [LICENSE](/LICENSE)\n\n## Contributing\n\nAll bug reports and pull requests are welcome that are focused on improving the current scope of this project.\n\n## About\n\n⚡️ hyper-ext-counter is an extension module for hyper-connect a client library for the ⚡️ hyper service. To learn more about ⚡️ hyper go to https://hyper.io \n\n\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhyper63%2Fhyper-ext-counter","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhyper63%2Fhyper-ext-counter","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhyper63%2Fhyper-ext-counter/lists"}