npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@satyakiraj/quicksolve

v1.0.2

Published

A simple and lightweight JavaScript library for performing mathematical operations such as addition, subtraction, multiplication, division, and more.

Readme

Math Utilities Library

A simple and lightweight JavaScript library for performing mathematical operations such as addition, subtraction, multiplication, division, and more.

Features

  • Add, subtract, multiply, or divide numbers
  • Compute advanced operations like factorials, GCD, LCM, square roots, and more
  • Generate random integers within a range
  • Calculate averages, medians, and powers

Installation

Install via npm:

npm install @satyakiraj/quicksolve

Alternatively, you can include the library in your project using a CDN:

<script src="https://cdn.jsdelivr.net/npm/@satyakiraj/quicksolve"></script>

Usage

Import the Library

In Node.js:

const math = require('@satyakiraj/quicksolve');

In ES Modules:

import * as math from '@satyakiraj/quicksolve';

Examples

Basic Arithmetic

// Addition
console.log(math.add(1, 2, 3)); // Output: 6

// Subtraction
console.log(math.subtract(10, 5)); // Output: 5

// Multiplication
console.log(math.multiply(2, 3, 4)); // Output: 24

// Division
console.log(math.divide(10, 3)); // Output: 3.33333

Advanced Operations

// Square Root
console.log(math.sqrt(16)); // Output: 4.00000

// Power
console.log(math.power(2, 3)); // Output: 8

// Factorial
console.log(math.factorial(5)); // Output: 120

// GCD
console.log(math.gcd(12, 15)); // Output: 3

// LCM
console.log(math.lcm(4, 6)); // Output: 12

// Median
console.log(math.median(1, 3, 2, 5, 4)); // Output: 3

Utilities

// Generate a Random Integer
console.log(math.random(1, 100)); // Output: Random integer between 1 and 100

// Average
console.log(math.average(10, 20, 30)); // Output: 20.00000

API Reference

Basic Arithmetic

  • add(...numbers): Returns the sum of all numbers provided.
  • subtract(a, b): Returns the difference between a and b.
  • multiply(...numbers): Returns the product of all numbers provided.
  • divide(a, b): Returns the result of dividing a by b (up to 5 decimal places).

Advanced Functions

  • average(...numbers): Calculates the average of the provided numbers.
  • factorial(n): Returns the factorial of n.
  • gcd(a, b): Finds the greatest common divisor of two numbers.
  • lcm(a, b): Finds the least common multiple of two numbers.
  • median(...numbers): Calculates the median of a set of numbers.
  • power(base, exponent): Calculates base raised to the power of exponent.
  • sqrt(number): Finds the square root of a number.

Utilities

  • random(min, max): Generates a random integer between min and max (inclusive).

Author

Created by Satyaki Raj.


keywords:

  • math
  • calculations
  • npm package
  • JavaScript