{"id":21691063,"url":"https://github.com/jsjoeio/use-streak","last_synced_at":"2025-04-12T09:43:50.958Z","repository":{"id":37649963,"uuid":"415339761","full_name":"jsjoeio/use-streak","owner":"jsjoeio","description":"a streak counter to track your streak in days (similar to Duolingo)","archived":false,"fork":false,"pushed_at":"2022-07-21T21:36:47.000Z","size":891,"stargazers_count":39,"open_issues_count":2,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-04-10T13:12:49.052Z","etag":null,"topics":["browser","duolingo","streak","typescript"],"latest_commit_sha":null,"homepage":"","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/jsjoeio.png","metadata":{"files":{"readme":"README.md","changelog":null,"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":"2021-10-09T14:58:35.000Z","updated_at":"2025-01-31T11:49:09.000Z","dependencies_parsed_at":"2022-09-11T20:00:34.818Z","dependency_job_id":null,"html_url":"https://github.com/jsjoeio/use-streak","commit_stats":null,"previous_names":[],"tags_count":0,"template":true,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jsjoeio%2Fuse-streak","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jsjoeio%2Fuse-streak/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jsjoeio%2Fuse-streak/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jsjoeio%2Fuse-streak/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jsjoeio","download_url":"https://codeload.github.com/jsjoeio/use-streak/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248550081,"owners_count":21122927,"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","duolingo","streak","typescript"],"created_at":"2024-11-25T17:36:11.447Z","updated_at":"2025-04-12T09:43:50.934Z","avatar_url":"https://github.com/jsjoeio.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# `useStreak` - a basic streak counter\r\n\r\n![npm](https://img.shields.io/npm/v/use-streak)\r\n\r\nThis is a basic streak counter - inspired by Duolingo - written in TypeScript and meant for the browser (uses `localStorage`).\r\n\r\n## Install\r\n\r\n```shell\r\nyarn add use-streak\r\n```\r\n\r\n```shell\r\nnpm install use-streak\r\n```\r\n\r\n### Usage\r\n\r\n```typescript\r\nimport { useStreak } from \"use-streak\";\r\n\r\nconst today = new Date();\r\nconst streak = useStreak(localStorage, today);\r\n// streak returns an object:\r\n// {\r\n//    currentCount: 1,\r\n//    lastLoginDate: \"11/11/2021\",\r\n//    startDate: \"11/11/2021\",\r\n// }\r\n```\r\n\r\n\u003cimg src=\"./streak-demo.png\" alt=\"screenshot of streak demo\" width=\"200\" /\u003e\r\n\r\n[![Edit vigorous-wood-o8m7w](https://codesandbox.io/static/img/play-codesandbox.svg)](https://codesandbox.io/s/vigorous-wood-o8m7w?fontsize=14\u0026hidenavigation=1\u0026theme=dark)\r\n\r\n## LICENSE\r\n\r\nMIT. Just make sure you give acknowledgements to this repo.\r\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjsjoeio%2Fuse-streak","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjsjoeio%2Fuse-streak","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjsjoeio%2Fuse-streak/lists"}