{"id":20283149,"url":"https://github.com/bsonntag/react-use-countdown","last_synced_at":"2025-07-21T12:03:33.096Z","repository":{"id":33206682,"uuid":"155006886","full_name":"bsonntag/react-use-countdown","owner":"bsonntag","description":"React hook for countdown state.","archived":false,"fork":false,"pushed_at":"2023-10-27T13:32:20.000Z","size":1940,"stargazers_count":19,"open_issues_count":2,"forks_count":2,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-06-16T17:59:48.933Z","etag":null,"topics":["countdown","hook","react","react-hooks"],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","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/bsonntag.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-10-27T20:35:17.000Z","updated_at":"2023-03-14T23:09:57.000Z","dependencies_parsed_at":"2024-06-19T05:32:25.892Z","dependency_job_id":"3e6dfb70-a144-4460-9ef6-b08fce07af0c","html_url":"https://github.com/bsonntag/react-use-countdown","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/bsonntag/react-use-countdown","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bsonntag%2Freact-use-countdown","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bsonntag%2Freact-use-countdown/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bsonntag%2Freact-use-countdown/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bsonntag%2Freact-use-countdown/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bsonntag","download_url":"https://codeload.github.com/bsonntag/react-use-countdown/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bsonntag%2Freact-use-countdown/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":266296762,"owners_count":23907012,"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","status":"online","status_checked_at":"2025-07-21T11:47:31.412Z","response_time":64,"last_error":null,"robots_txt_status":null,"robots_txt_updated_at":null,"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":["countdown","hook","react","react-hooks"],"created_at":"2024-11-14T14:13:25.098Z","updated_at":"2025-07-21T12:03:33.067Z","avatar_url":"https://github.com/bsonntag.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# react-use-countdown\n\n[![CircleCI](https://circleci.com/gh/bsonntag/react-use-countdown.svg?style=svg)](https://circleci.com/gh/bsonntag/react-use-countdown)\n\nReact Hook for countdown state.\n\n## Installation\n\nUsing npm:\n\n```sh\n$ npm install --save react-use-countdown\n```\n\nUsing yarn:\n\n```sh\n$ yarn add react-use-countdown\n```\n\nSince this module uses React's new [Hooks feature](https://reactjs.org/docs/hooks-intro.html),\nto try this out you'll need to install at least version `16.8.0`\nof `react` and `react-dom`:\n\n```sh\n$ yarn add react@^16.8.0 react-dom@^16.8.0\n```\n\n## Usage\n\n```js\nimport React from 'react';\nimport parseMs from 'parse-ms';\nimport useCountdown from 'react-use-countdown';\n\nfunction Example() {\n  const countdown = useCountdown(() =\u003e Date.now() + 10000);\n  const { seconds } = parseMs(countdown);\n\n  return \u003cp\u003eHooked in {seconds}\u003c/p\u003e;\n}\n```\n\n## API\n\n```js\nuseCountdown(\n  date: () =\u003e Date | string | number,\n  options?: {\n    intervalTime?: number,\n    now?: () =\u003e Date | string | number\n  }\n): number\n```\n\nReceives a function that returns a date and returns the number of milliseconds remaining until that date.\n\nOptionally receives:\n\n- `intervalTime`: the milliseconds between ticks, 1000 by default.\n- `now`: a function that returns the current time as the second argument.\n\n## Contributing\n\nPlease feel free to submit any issues or pull requests.\n\n## License\n\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbsonntag%2Freact-use-countdown","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbsonntag%2Freact-use-countdown","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbsonntag%2Freact-use-countdown/lists"}