1.0.1 • Published 3 years ago
simplechronometer v1.0.1
simpleChronometer
Simple, high precision chronometer for browsers.
Usage
import simpleChronometer from 'simplechronometer';
const {
element, // Html element of timer
start, // Start the timer
pause, // Pause the timer
reset, // Stop and reset the timer
getTime, // Get elapsed time as milliseconds
} = simpleChronometer({
showMilliSecond: true, // Show milliseconds (default false)
querySelector: '#target', // Selector to replace with the timer on the dom(optional, you can later manually insert the element to the DOM as well)
color: 'white', // Text color (default white)
bgColor: 'black', // Background color (default black)
borderColor: 'black', // Border color (default black)
size: 'medium', // Size of timer: [xlarge,large,medium,small,xsmall] (default medium)
});
Dependencies
This component uses htmlElementGenerator to render its element.
Tests
npm install
npm run test