# count-down-ts

> Countdown has timer, count, clear features. Test covered 100%.

Latest version **1.0.3** (published 2020-07-14) · GPL-3.0 license · 0 weekly downloads

## Install

```sh
npm install count-down-ts
pnpm add count-down-ts
yarn add count-down-ts
bun add count-down-ts
```

## Health

**Score 30/100 (F)** — status: abandoned.

Positive: has types; esm support; no vulnerabilities; high quality score.

Warnings: low downloads.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.3 |
| Published | 2020-07-14 |
| First published | 2020-05-13 |
| Weekly downloads | 0 |
| License | GPL-3.0 |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 0 |
| Unpacked size | 39.8 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | sanshuiwang |
| Maintainers | sanshuiwang |
| Keywords | countdown |

## Links

- npm: https://www.npmjs.com/package/count-down-ts
- Repository: https://github.com/sanshuiwang/count-down-ts
- Homepage: https://github.com/sanshuiwang/count-down-ts#readme
- Issues: https://github.com/sanshuiwang/count-down-ts/issues
- npm.io page: https://npm.io/package/count-down-ts

## Recent versions

- 1.0.3 (latest) — 2020-07-14
- 1.0.2 — 2020-05-26
- 1.0.1 — 2020-05-22
- 1.0.0 — 2020-05-13

## README

# count-down-ts

[![NPM version][npm-image]][npm-url]
[![Build Status][travis-image]][travis-url]
![][travis-url]
[![Coverage Status][coverage-image]][coverage-url]
![][david-url]
![][dt-url]
[![code style: prettier][prettier-image]][prettier-url]
![][license-url]

Countdown has timer, count, clear features. Test covered 100%.

## Install

### npm

```bash
npm install count-down-ts --save
```

### yarn

```bash
yarn add count-down-ts --save
```

### bower

```bash
bower install count-down-ts --save
```

## Import

### ES2015

```typescript
import countdown from 'count-down-ts'
```

### CommonJS

```javascript
const countdown = require('count-down-ts')
```

### script

```html
<!DOCTYPE html>
<html>
  <head>
    <meta charset="UTF-8" />
    <title>DEMO</title>
  </head>
  <body>
    <script type="text/javascript" src="node_modules/count-down-ts/dist/count-down-ts.js"></script>
    <script type="text/javascript">
      var countdown = window.countdown
    </script>
  </body>
</html>
```

## Usage

```typescript
// init countdown
countdown.start(60, 0, c => console.log(c))

OR

countdown.start()

// cleat countdown setTimeout & count & timer
countdown.clear()

// countdown setTimeout return value
countdown.timer

// countdown current number
countdown.count
```

### accept-expression

#### countdown.start(count, down, callback)

`count`: Default 60, type number. Tips: count must greater than down, or equal down.

`down`: Default 0, type number.

`callback`: Type (c: number) => void.

## LICENSE

[GPL v3 License](https://raw.githubusercontent.com/sanshuiwang/count-down-ts/master/LICENSE)

[npm-url]: https://npmjs.org/package/count-down-ts
[npm-image]: https://badge.fury.io/js/count-down-ts.png
[travis-image]: https://www.travis-ci.org/sanshuiwang/count-down-ts.svg?branch=master
[travis-url]: https://travis-ci.com/sanshuiwang/count-down-ts
[coverage-image]: https://coveralls.io/repos/github/sanshuiwang/count-down-ts/badge.svg?branch=master
[coverage-url]: https://coveralls.io/github/sanshuiwang/count-down-ts
[david-url]: https://david-dm.org/sanshuiwang/count-down-ts.png
[dt-url]: https://img.shields.io/npm/dt/count-down-ts.svg
[license-url]: https://img.shields.io/npm/l/count-down-ts.svg
[prettier-image]: https://img.shields.io/badge/code_style-prettier-ff69b4.svg
[prettier-url]: https://github.com/prettier/prettier

---
_Source: https://npm.io/package/count-down-ts · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
