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 🙏

© 2025 – Pkg Stats / Ryan Hefner

mathora

v0.0.6

Published

A collection of custom Angular pipes for mathematical operations, including arithmetic, algebra, trigonometry, rounding, statistical calculations, and developer utilities.

Readme

Mathora

A collection of custom Angular pipes for mathematical operations, including arithmetic, algebra, trigonometry, rounding, statistical calculations, and developer utilities.

Table of Contents

Installation

To use mathora in your Angular project, follow these steps:

  1. Install the package using npm or yarn:

    npm install mathora

    or

    yarn add mathora
  2. Import the MathoraModule in your Angular module (e.g., app.module.ts):

    import { MathoraModule } from "mathora";
    
    @NgModule({
      imports: [
        // other imports
        MathoraModule,
      ],
      // other configurations
    })
    export class AppModule {}

    Note: Verify the package name and Angular version compatibility in the project's documentation or package.json. You may need specific versions of Angular or other dependencies.

Available Pipes

The mathora library provides a variety of pipes organized by functionality. Below is a detailed list of all available pipes, including descriptions and usage examples.

Algebra

| Pipe | Description | Example | Output | | ----------- | --------------------------------------- | ---------------------- | ------ | | factorial | Calculates the factorial of a number. | {{ 5 \| factorial }} | 120 | | log | Calculates the logarithm (base 10). | {{ 100 \| log }} | 2 | | pow | Raises a number to a specified power. | {{ 2 \| pow:3 }} | 8 | | sqrt | Calculates the square root of a number. | {{ 16 \| sqrt }} | 4 |

Arithmetic

| Pipe | Description | Example | Output | | ------------ | -------------------------------------- | --------------------------- | ------ | | add | Adds two numbers. | {{ 2 \| add:3 }} | 5 | | subtract | Subtracts two numbers. | {{ 5 \| subtract:3 }} | 2 | | multiply | Multiplies two numbers. | {{ 4 \| multiply:3 }} | 12 | | divide | Divides two numbers. | {{ 10 \| divide:2 }} | 5 | | mod | Calculates the modulus of two numbers. | {{ 10 \| mod:3 }} | 1 | | percentage | Calculates the percentage of a number. | {{ 50 \| percentage:20 }} | 10 |

Developer

| Pipe | Description | Example | Output | | ----------------- | ------------------------------------------ | ------------------------------------- | ------- | | format-number | Formats a number with decimal places. | {{ 1234.5678 \| formatNumber:2 }} | 1234.57 | | math-expression | Evaluates a mathematical expression. | {{ '2 + 3 * 4' \| mathExpression }} | 14 | | shorten-number | Shortens large numbers (e.g., 1000 to 1K). | {{ 1000000 \| shortenNumber }} | 1M |

Misc

| Pipe | Description | Example | Output | | ----- | --------------------------------------- | ----------------- | ------ | | abs | Returns the absolute value of a number. | {{ -5 \| abs }} | 5 |

Rounding

| Pipe | Description | Example | Output | | ------- | ----------------------------------- | -------------------- | ------ | | ceil | Rounds up to the nearest integer. | {{ 4.2 \| ceil }} | 5 | | floor | Rounds down to the nearest integer. | {{ 4.8 \| floor }} | 4 | | round | Rounds to the nearest integer. | {{ 4.5 \| round }} | 5 |

Statistical

| Pipe | Description | Example | Output | | -------- | ---------------------------------- | ---------------------------------- | ------ | | mean | Calculates the mean of an array. | {{ [1, 2, 3, 4, 5] \| mean }} | 3 | | median | Calculates the median of an array. | {{ [1, 2, 3, 4, 5] \| median }} | 3 | | mode | Calculates the mode of an array. | {{ [1, 2, 2, 3, 3, 3] \| mode }} | 3 | | range | Calculates the range of an array. | {{ [1, 2, 3, 4, 5] \| range }} | 4 |

Trigonometry

| Pipe | Description | Example | Output | | ----- | --------------------------------------------- | ---------------- | ------ | | cos | Calculates the cosine of an angle (radians). | {{ 0 \| cos }} | 1 | | sin | Calculates the sine of an angle (radians). | {{ 0 \| sin }} | 0 | | tan | Calculates the tangent of an angle (radians). | {{ 0 \| tan }} | 0 |

Contact

For questions, issues, or feedback, please contact Jenil Sojitra: