2.0.0 • Published 5 years ago
binary-clock-core v2.0.0
Binary Clock Core
Implementation of the core logic for a binary clock.
Features
~320 Bytes& 0 dependencies
Installation
npm install --save binary-clock-coreUsage
The library has four core APIs
getTimegetHoursgetMinutesgetSeconds
2. Using the core API
import * as clock from 'binary-clock-core';
const currDate = new Date();
clock.getTime(currDate);
clock.getHours(currDate);
clock.getMinutes(currDate);
clock.getSeconds(currDate);3. Sample output
Use the clock coordinates below to display a time unit.
{
a4: 'Off',
a3: 'Off',
a2: 'On',
a1: 'Off',
b4: 'Off',
b3: 'Off',
b2: 'On',
b1: 'Off'
}Clock Coordinates
