npm.io
1.0.3 • Published 2 years ago

simple-calculator-v1

Licence
MIT
Version
1.0.3
Deps
0
Size
2 kB
Vulns
0
Weekly
0

Calculator Project Documentation

Overview

This project is a simple calculator implemented in JavaScript, allowing users to perform basic arithmetic operations and generate a random ID.

Features

1. Addition
  • Function: add(a, b)
  • Description: Adds two numbers (a and b) and returns the result.
2. Subtraction
  • Function: sub(a, b)
  • Description: Subtracts the second number (b) from the first number (a) and returns the result.
3. Multiplication
  • Function: mul(a, b)
  • Description: Multiplies two numbers (a and b) and returns the result.
4. Division
  • Function: div(a, b)
  • Description: Divides the first number (a) by the second number (b) and returns the result.
5. Random ID Generation
  • Function: uid()
  • Description: Generates a random alphanumeric ID.

Usage

  1. Include the calculator module in your JavaScript project:

    const { add, sub, mul, div, uid } = require('./simple-calculator');

Keywords