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

mathematiqs

v1.0.0

Published

Mathematiqs is a robust TypeScript library offering a comprehensive suite of mathematical functions

Readme

Mathematiqs

Version Downloads Number of GitHub contributors GitHub commit activity Number of GitHub stars License MIT

Mathematiqs is a robust TypeScript library offering a comprehensive suite of mathematical functions suitable for both browser and Node.js environments. It encompasses a wide array of operations, including basic arithmetic, trigonometry, logarithms, and more. Additionally, it features a command-line interface (CLI) for the convenient evaluation of expressions.

What's New

  • Added proper error handling and parameter checks
  • Fixed some functions
  • Renamed crt to nthRoot

Features

  • Comprehensive Mathematical Functions:

    • Basic Operations: add, subtract, multiply, divide, mod
    • Exponential & Root Functions: pow, sqrt, cbrt, crt
    • Logarithmic Functions: log, log10
    • Trigonometric Functions: sin, cos, tan, cosec, sec, cot
    • Angle Conversion: toRad, toDeg
    • Number Theory: gcd, primeFactors, lcm, isPrime, isEven, isOdd, factorial
    • Statistical Functions: median, avg
    • Rounding & Absolute Values: round, abs
    • Randomization: random
  • Command-Line Interface (CLI): Evaluate mathematical expressions directly from the terminal for quick computations.

  • Full TypeScript Support: Includes type definitions to ensure seamless integration and development.

  • Lightweight and Efficient: Designed to be fast with minimal dependencies, making it suitable for various applications.

Installation

To install the package, use npm:

npm install mathematiqs

Or, if you prefer using yarn:

yarn add mathematiqs

Usage

Importing the Library

Import the desired functions into your TypeScript project as follows:

import { add, subtract, multiply, divide } from "mathematiqs"

Example Usage

console.log(add(1, 2)) // Output: 3
console.log(multiply(4, 5)) // Output: 20
console.log(sin(Math.PI / 2)) // Output: 1

CLI Usage

After installation, you can use the Mathematiqs CLI to evaluate mathematical expressions directly from your terminal.

  1. Install Globally (Optional):

    npm install -g mathematiqs
  2. Evaluate Expressions:

    maths add(1, 4);    // Output: Result: 5
    maths sqrt(16);     // Output: Result: 4

Available Operations

  • Basic Math: add(a, b), subtract(a, b), multiply(a, b), divide(a, b)
  • Trigonometry: sin(x), cos(x), tan(x), cosec(x), sec(x), cot(x)
  • Logarithms: log(x), log10(x)
  • Other Functions: sqrt(x), pow(x, y), round(x), random(), toRad(x), toDeg(x), fact(x)

Frequently Asked Questions

Q1: Is Mathematiqs suitable for both client-side and server-side applications?

Yes, Mathematiqs is designed to work seamlessly in both browser and Node.js environments, making it versatile for various applications.

Q2: Does Mathematiqs support TypeScript?

Absolutely. Mathematiqs is built with full TypeScript support, including comprehensive type definitions to enhance the development experience.

Q3: How can I contribute to the Mathematiqs library?

We appreciate contributions from the community. Please check our CONTRIBUTING.md file for detailed guidelines on how to contribute.

Q4: Is there a command-line interface available for Mathematiqs?

Yes, Mathematiqs offers a CLI that allows you to evaluate mathematical expressions directly from your terminal. This can be particularly useful for quick calculations and scripting.

Contributing

We welcome contributions! Please refer to the CONTRIBUTING.md for guidelines.

Credits

This library is maintained by @MFM-347.

License

The code in this repository is licensed under the MIT License. View more information here.