New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

javascript-calculator

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

javascript-calculator

This is a simple Js Calculator

latest
Source
npmnpm
Version
1.0.7
Version published
Maintainers
1
Created
Source

Javascript-Calculator

This is a Simple Javascript Calculator

Demo

Demo

Feature

  • Support Keyboard Key bindings;

Keyboard

  • Type 0 to 9 Numbers;
  • Shift plus + : will add the Numbers;
  • Shift plus * : will multiply the Numbers;
  • -: will subtract the Numbers;
  • / : will divide the Numbers;
  • = : will give the Output;
  • backspace : will clear the values;

Options

NameDescriptionType
backgroundchange the calculator backgroundString
numbersBackgroundchange the numbers box backgroundString
numbersColorchange the numbers box colorString
operatorsBackgroundchange the operators box backgroundString
operatorsColorchange the operators box colorString
clearAndEqualBackgroundschange the clear and equal box backgroundString
clearAndEqualColorschange the clear and equal box colorString

Note

Add index.js to your html file

Example

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Calculator</title>
    <script src="../node_modules/src/index.js"></script>
</head>
<body>
</body>
</html>

Step 1: add some class to the div.

<div class="wrapper"></div>

Step 2: Initialize the plugin on your page. For example

// initialize with defaults
$(".wrapper").javascriptCalcInit();

// initialize with options
$(".wrapper").javascriptCalcInit({
        background:'black',
        numbersBackground:'#8c4141',
        numbersColor:'white',
        operatorsBackground:'#FF5722',
        operatorsColor:'white',
        clearAndEqualBackgrounds:'#8c4141',
        clearAndEqualColors:'white',
});

Using NPM

To install using the npm package manager run:

$ npm install javascript-calculator

Contribute

Contributions are always welcome!

Keywords

npm

FAQs

Package last updated on 06 Dec 2018

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