{"id":15070134,"url":"https://github.com/tiagocastro070/countdown","last_synced_at":"2025-04-10T17:33:50.580Z","repository":{"id":57146134,"uuid":"268367953","full_name":"tiagocastro070/countdown","owner":"tiagocastro070","description":"Simple, lightweight and very easy to use JS Countdown package.","archived":false,"fork":false,"pushed_at":"2020-05-31T22:25:47.000Z","size":22,"stargazers_count":6,"open_issues_count":0,"forks_count":2,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-05-30T17:44:19.708Z","etag":null,"topics":["countdown","countdown-clock","countdown-timer","js","timer"],"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/tiagocastro070.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":"2020-05-31T21:34:02.000Z","updated_at":"2024-04-15T21:37:57.000Z","dependencies_parsed_at":"2022-09-06T13:02:04.551Z","dependency_job_id":null,"html_url":"https://github.com/tiagocastro070/countdown","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/tiagocastro070%2Fcountdown","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tiagocastro070%2Fcountdown/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tiagocastro070%2Fcountdown/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tiagocastro070%2Fcountdown/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tiagocastro070","download_url":"https://codeload.github.com/tiagocastro070/countdown/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248262020,"owners_count":21074229,"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":["countdown","countdown-clock","countdown-timer","js","timer"],"created_at":"2024-09-25T01:48:30.236Z","updated_at":"2025-04-10T17:33:50.551Z","avatar_url":"https://github.com/tiagocastro070.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Countdown\nSimple, lightweight and very easy to use Countdown package.\n\n\u003cimg src=\"https://raw.githubusercontent.com/tiagocastro070/countdown/master/countdown.png\"/\u003e\n\n## Installation\n```\nnpm install countdown-tmr\n\nimport Countdown from 'countdown-tmr';\n```\n\n```javascript\nconst elm = document.querySelector('#my-countdown')\nconst options = {\n  date: '3 Jul 2020 08:00:00',\n  labels: {\n    days: 'd',\n    hours: 'h',\n    minutes: 'm',\n    seconds: 's'\n  }\n}\nconst countdown = new Countdown(elm, settings).play()\n```\n\n## Properties\nProperty | Type | Default Value\n-|-|-\ndate | string | 24 hours from current date. Format: '3 Jul 2020 08:00:00'\nplaying | bool | true\nlabels | object | days: 'days',\u003cbr\u003ehours: 'hours'\u003cbr\u003eminutes: 'minutes',\u003cbr\u003eseconds: 'seconds'\n\n## Methods\nMethod | Function\n-| -\nplay | Initializes the countdown\nstop | Stops the countdown\ngetRemaining | Returns the remaining value (in miliseconds) of a given argument. Available arguments are 'days', 'hours', 'minutes' and 'seconds'.\n\n## Events\nEvents can be accessed through the ```on()``` method.\n```javascript\non(eventType, callbackFn)\n```\nEvents are triggered every time certain value changes (e.g. from 2 hours to 1 hour). Here is the events list:\n - `on('days', callbackFn)`\n - `on('hours', callbackFn)`\n - `on('minutes', callbackFn)`\n - `on('seconds', callbackFn)`\n```javascript\ncoundown.on('hours', myCallback)\n\nfunction myCallback() {\n  console.log('an hour less to go')\n}\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftiagocastro070%2Fcountdown","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftiagocastro070%2Fcountdown","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftiagocastro070%2Fcountdown/lists"}