{"id":22433713,"url":"https://github.com/gavinning/countdown","last_synced_at":"2025-03-27T07:46:05.231Z","repository":{"id":143897524,"uuid":"50906824","full_name":"gavinning/countdown","owner":"gavinning","description":"终端倒计时","archived":false,"fork":false,"pushed_at":"2016-02-02T08:47:52.000Z","size":370,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-02-01T12:46:37.388Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"JavaScript","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/gavinning.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}},"created_at":"2016-02-02T08:46:51.000Z","updated_at":"2020-05-29T03:49:56.000Z","dependencies_parsed_at":"2023-04-24T19:46:58.525Z","dependency_job_id":null,"html_url":"https://github.com/gavinning/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/gavinning%2Fcountdown","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gavinning%2Fcountdown/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gavinning%2Fcountdown/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gavinning%2Fcountdown/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/gavinning","download_url":"https://codeload.github.com/gavinning/countdown/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245806390,"owners_count":20675296,"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":[],"created_at":"2024-12-05T22:15:43.964Z","updated_at":"2025-03-27T07:46:05.123Z","avatar_url":"https://github.com/gavinning.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Countdown\n倒计时\n\n\n\n#### Install\n```\nnpm i node-countdown --save\n```\n\n#### Example\n```js\nvar countdown = require('node-countdown');\n\ncountdown.start(5000, {suffix: '后开始备份'}, function(err){\n    err ?\n        console.log(err.message):\n        console.log('开始备份...');\n})\n```\n\n#### API\n```js\ncountdown.start(time [, options, fn])\n\noptions = {\n    prefix: '前缀',\n    suffix: '后缀',\n    // 循环任务\n    loop: false,\n    // 时间单位格式化数组\n    // eg: ['years', 'months', ...]\n    format: ['年', '月', '天', '小时', '分', '秒']\n}\n```\n\n``time`` 倒计时时间，单位ms  \n``options``  \n* ``prefix`` 描述信息前缀\n* ``suffix`` 描述信息后缀\n* ``loop`` 是否建立循环任务，默认为``false``\n* ``format`` 时间单位格式化数组  \n\n``fn`` 倒计时完成后回调\n\n\n#### Preview\n``loop: false``  \n![Preview](1.gif)  \n``loop: true``  \n![Preview loop](2.gif)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgavinning%2Fcountdown","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgavinning%2Fcountdown","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgavinning%2Fcountdown/lists"}