GithubHelp home page GithubHelp logo

dengnan123 / count-down-ts Goto Github PK

View Code? Open in Web Editor NEW

This project forked from sanshuiwang/count-down-ts

0.0 1.0 0.0 234 KB

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

License: GNU General Public License v3.0

JavaScript 18.06% TypeScript 81.94%

count-down-ts's Introduction

count-down-ts

NPM version Build Status Coverage Status code style: prettier

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

Install

npm

npm install count-down-ts --save

yarn

yarn add count-down-ts --save

bower

bower install count-down-ts --save

Import

ES2015

import countdown from 'count-down-ts'

CommonJS

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

script

<!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

// 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

count-down-ts's People

Contributors

sanshuiwang avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.