{"id":16635073,"url":"https://github.com/imballinst/count-up-down","last_synced_at":"2026-06-20T08:31:11.457Z","repository":{"id":45611132,"uuid":"400930536","full_name":"imballinst/count-up-down","owner":"imballinst","description":"Base countdown or count-up timer for simple static pages.","archived":false,"fork":false,"pushed_at":"2021-12-05T12:58:52.000Z","size":475,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-09-24T06:54:06.519Z","etag":null,"topics":["javascript","timer","typescript"],"latest_commit_sha":null,"homepage":"https://imballinst.github.io/count-up-down/","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/imballinst.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-08-29T02:09:47.000Z","updated_at":"2021-12-05T12:57:40.000Z","dependencies_parsed_at":"2022-09-11T16:21:46.099Z","dependency_job_id":null,"html_url":"https://github.com/imballinst/count-up-down","commit_stats":null,"previous_names":[],"tags_count":9,"template":false,"template_full_name":null,"purl":"pkg:github/imballinst/count-up-down","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/imballinst%2Fcount-up-down","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/imballinst%2Fcount-up-down/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/imballinst%2Fcount-up-down/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/imballinst%2Fcount-up-down/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/imballinst","download_url":"https://codeload.github.com/imballinst/count-up-down/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/imballinst%2Fcount-up-down/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34563535,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-20T02:00:06.407Z","response_time":98,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","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":["javascript","timer","typescript"],"created_at":"2024-10-12T05:49:56.138Z","updated_at":"2026-06-20T08:31:11.441Z","avatar_url":"https://github.com/imballinst.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# count-up-down\n\nThis is the base repository that I use to create a simple static page for counting up or down.\n\n## How to Use\n\n### Browser\n\nWe are using [jsDelivr](https://www.jsdelivr.com/) to distribute the package for browser usage. The HTML snippet is as the following.\n\n```html\n\u003cdiv class=\"root\"\u003e\n  \u003cdiv class=\"row\"\u003e\n    \u003cdiv class=\"wrapper\"\u003e\n      \u003cdiv class=\"value\" id=\"years\"\u003e\u003c/div\u003e\n      \u003cdiv class=\"unit\"\u003eyears\u003c/div\u003e\n    \u003c/div\u003e\n    \u003cdiv class=\"wrapper\"\u003e\n      \u003cdiv class=\"value\" id=\"months\"\u003e\u003c/div\u003e\n      \u003cdiv class=\"unit\"\u003emonths\u003c/div\u003e\n    \u003c/div\u003e\n    \u003cdiv class=\"wrapper\"\u003e\n      \u003cdiv class=\"value\" id=\"days\"\u003e\u003c/div\u003e\n      \u003cdiv class=\"unit\"\u003edays\u003c/div\u003e\n    \u003c/div\u003e\n  \u003c/div\u003e\n  \u003cdiv class=\"row\"\u003e\n    \u003cdiv class=\"wrapper\"\u003e\n      \u003cdiv class=\"value\" id=\"hours\"\u003e\u003c/div\u003e\n      \u003cdiv class=\"unit\"\u003ehours\u003c/div\u003e\n    \u003c/div\u003e\n    \u003cdiv class=\"wrapper\"\u003e\n      \u003cdiv class=\"value\" id=\"minutes\"\u003e\u003c/div\u003e\n      \u003cdiv class=\"unit\"\u003eminutes\u003c/div\u003e\n    \u003c/div\u003e\n    \u003cdiv class=\"wrapper\"\u003e\n      \u003cdiv class=\"value\" id=\"seconds\"\u003e\u003c/div\u003e\n      \u003cdiv class=\"unit\"\u003eseconds\u003c/div\u003e\n    \u003c/div\u003e\n  \u003c/div\u003e\n\u003c/div\u003e\n\n\u003cscript src=\"https://cdn.jsdelivr.net/npm/count-up-down@0.2.3/dist/count-up-down.min.js\"\u003e\u003c/script\u003e\n\u003cscript\u003e\n  const ONE_HOUR_AGO = new Date(new Date().getTime() - 3600 * 1000);\n\n  window.addEventListener('load', () =\u003e {\n    // This will render to the divs with the ID \"years\", \"months\", and so on.\n    renderToDivs(calculate(ONE_HOUR_AGO, new Date()).result);\n\n    setInterval(() =\u003e {\n      renderToDivs(calculate(ONE_HOUR_AGO, new Date()).result);\n    }, 1000);\n  });\n\u003c/script\u003e\n```\n\n### Node\n\nTo install the package, if you are using `npm`:\n\n```bash\n# NPM.\nnpm install --save count-up-down\n\n# Or, if you are using yarn:\nyarn add count-up-down\n```\n\nThen, do this in your file:\n\n```ts\nimport { calculate } from 'count-up-down';\n\nconst ONE_HOUR_AGO = new Date(new Date().getTime() - 3600 * 1000);\n\n// {\n//   result: { days: 0, hours: 1, minutes: 0, months: 0, seconds: 0, years: 0 },\n//   type: 'countdown'\n// }\nconsole.log(calculate(new Date(), ONE_HOUR_AGO));\n```\n\n## Documentation\n\nThe API documentation is generated using [`typedoc`](https://github.com/TypeStrong/typedoc). Below are the links to the browser and Node package:\n\n1. [Browser](./api/docs/modules/browser.md)\n2. [Node](./api/docs/modules/node.md)\n\nTo re-generate the documentation, we can do `yarn generate:doc` on the the root of this repository.\n\n## Development\n\n### Prerequisites\n\n1. [Yarn](https://yarnpkg.com/) Classic (v1)\n2. [Node.js®](https://nodejs.org/) LTS (at least v14)\n\nAfter that, on root project, do this to install the dependencies:\n\n```bash\nyarn\n```\n\n### Folder Information\n\nThe following is the information on each of the important folders in this repository.\n\n1. `plugins` folder contains the plugins for `esbuild`\n2. `scripts` folder contains build scripts\n3. `src` folder contains the main library code\n\n## Versioning\n\nThis library follows semantic versioning. Please visit https://semver.org for more information.\n\n## License\n\nSee [LICENSE](./LICENSE).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fimballinst%2Fcount-up-down","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fimballinst%2Fcount-up-down","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fimballinst%2Fcount-up-down/lists"}