binary-clock-js

2.0.0 • Public • Published

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});
    

Package Sidebar

Install

npm i binary-clock-js

Weekly Downloads

0

Version

2.0.0

License

ISC

Unpacked Size

80.4 kB

Total Files

9

Last publish

Collaborators

  • anjnkmr