Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

cli-dot-matrix-display

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

cli-dot-matrix-display

A library to create a command line dot matrix display.

  • 0.1.2
  • latest
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

cli-dot-matrix-display

A library to create a command line dot matrix display.

Install

$ npm install cli-dot-matrix-display

Usage

var cliDotMatrixDisplay = require('cli-dot-matrix-display');

var width   = 128;
var height  = 32;
var display = new cliDotMatrixDisplay.builder(width, height);

/* print some custom dots */
var dots = {
    0: {
        0: true
    },
    1: {
        1: true
    },
    2: {
        2: true
    },
    3: {
        3: true
    }
};
console.log('――――――――――');
display.setDots(dots, true);
console.log(display.getPanel());
console.log('――――――――――');

/* print all dots */
console.log('――――――――――');
display.enableAllDots();
console.log(display.getPanel());
console.log('――――――――――');

/* print empty display */
console.log('――――――――――');
display.resetPanel();
console.log(display.getPanel());
console.log('――――――――――');

/* print sinus curve */
console.log('――――――――――');
var heightHalf = Math.floor((height - 1) / 2);
display.setDotsByCallback(function (x) {
    return Math.sin(16 * x * Math.PI / 180) * heightHalf + heightHalf;
}, true, {'fill-below': true});
console.log(display.getPanel());
console.log('――――――――――');

/* print increasing line */
console.log('――――――――――');
display.setDotsByCallback(function (x) {
    return x / 4;
}, true, {'fill-above': true});
console.log(display.getPanel());
console.log('――――――――――');

console.log('');

cli-dot-matrix-display!

License

ISC © Björn Hempel

FAQs

Package last updated on 19 Feb 2017

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc