{"id":19793560,"url":"https://github.com/darky/ttl-counter","last_synced_at":"2026-01-19T03:33:19.210Z","repository":{"id":44070078,"uuid":"206647669","full_name":"darky/ttl-counter","owner":"darky","description":"TTL counter","archived":false,"fork":false,"pushed_at":"2024-06-16T14:22:05.000Z","size":650,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-29T13:55:26.246Z","etag":null,"topics":["counter","ttl"],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","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/darky.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":"2019-09-05T20:02:25.000Z","updated_at":"2024-06-16T14:22:02.000Z","dependencies_parsed_at":"2024-06-16T15:46:52.140Z","dependency_job_id":"47513dca-7414-4703-a90a-4c4ff888cbe3","html_url":"https://github.com/darky/ttl-counter","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/darky%2Fttl-counter","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/darky%2Fttl-counter/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/darky%2Fttl-counter/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/darky%2Fttl-counter/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/darky","download_url":"https://codeload.github.com/darky/ttl-counter/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247289448,"owners_count":20914463,"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":["counter","ttl"],"created_at":"2024-11-12T07:10:20.716Z","updated_at":"2026-01-19T03:33:19.204Z","avatar_url":"https://github.com/darky.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# TTL counter\n\nTTL counter allow you to define some counters with TTL expire. Also you can call callback, when some threshold of counter reached.\n\n### Example\n\n```typescript\nimport { TTLCounter } from 'ttl-counter';\n\nconst ttlCounter = new TTLCounter({\n  ttl: 60 * 1000 // TTL for specific counter,\n  countForCb: 50 // After 50 count per minute, callback called,\n  cb (counterId) {\n    // For example, many errors occured per minute, restart pod\n    process.exit(1);\n  }\n});\n\n// On error call\nttlCounter.count('error');\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdarky%2Fttl-counter","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdarky%2Fttl-counter","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdarky%2Fttl-counter/lists"}