2.0.0 • Published 3 years ago

binary-clock-js v2.0.0

Weekly downloads
-
License
ISC
Repository
github
Last release
3 years ago

Binary Clock JS

NPM

This displays the draws the Binary Clock on a Canvas or Terminal

Directory Structure

  1. node: this directory contains the example usage of this library in node js environment
  2. web: this directory contains the example usage of this library in browser environment
  3. binary-clock.js: source code of the library.
  4. package.json: package info

Screenshots

Screenshot 1

Screenshot 2

Screenshot 3

Screenshot 4 - Terminal

Integration Steps for Web

  1. Install binary-clock-js through npm.
    npm i binary-clock-js -s
  2. Add canvas tag to your html as below
    <canvas id="binary-clock-canvas"></canvas>
  3. Add the binary-clock.js script to your html as below

    <script src="/path_to_node_modules/binary-clock-js/binary-clock.js"></script>
    <script>
     new BinaryClock(new Date(), document.getElementById('binary-clock-canvas'))
    </script>
  4. Web Demo: Link

Integration Steps for Terminal

  1. Install binary-clock-js through npm.
    npm i binary-clock-js -s
  2. Import BinaryClock to your application.
    let { BinaryClock } = require('binary-clock');
  3. Use the below function same as in Web

    (Second parameter should be null as it is used for canvas object in the web implementation)

    // Usage with Default Options
    new BinaryClock();
    
    // Usage with autoUpdate false
    new BinaryClock(new Date(), null, {autoUpdate: false});