An open API service indexing awesome lists of open source software.

https://github.com/renjithspace/timers.js

Pure JavaScript timer plugin
https://github.com/renjithspace/timers.js

javascript timer

Last synced: about 2 months ago
JSON representation

Pure JavaScript timer plugin

Awesome Lists containing this project

README

        

# Timers.js
Pure JavaScript timer plugin

## Installation
**NPM**
```sh
npm install timers.js --save
```
**In Node.js**
```js
require('timers.js')
```
**Direct download** from [latest releases](https://github.com/renjithvk/timer.js/releases)

## Usage
**Include**
```js

```
**Initialize**
```js
new Timer();
```

## Configuration
```js
new Timer({
// Options here
property: value,
...
});
```

## Options
| Property | Description | Available values | Default value |
|--------------|----------------------|---------------------------|---------------|
| el | Timer.js element | Element selector (string) | '.timer' |
| time.second | Set initial second | integer | 0 |
| time.minute | Set initial minute | integer | 0 |
| time.hour | Set initial hour | integer | 0 |
| isStoped | Set timer status | boolean | false |

## Methods


Method
Description


.get('second|minute|hour')
Get the current time


.set('second|minute|hour', value)
Set time


.pause()
Pause the timer


.stop()
Stop the timer


.resume()
Resume the timer