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
- Host: GitHub
- URL: https://github.com/renjithspace/timers.js
- Owner: renjithspace
- Created: 2017-10-11T03:25:25.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2019-06-22T13:12:29.000Z (almost 6 years ago)
- Last Synced: 2025-03-18T18:29:19.872Z (2 months ago)
- Topics: javascript, timer
- Language: JavaScript
- Homepage: https://git.io/vFUhy
- Size: 30.3 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
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