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 🙏

© 2024 – Pkg Stats / Ryan Hefner

mathematical-pkg

v1.0.2

Published

Mathematical package with basic operations

Downloads

4

Readme

Mathematical-pkg

Documentation landing page: mathematical-pkg.vercel.app

Mathematical-pkg is a basic math library that manage basic operations like, addition, subtraction, division, multiplication, volume, area and perimeter formulas, and the general formula.

Version

Features

  • Contains differente types of math operations.
  • Runs on any JavaScript engine.
  • Open source.

Supported Operations

  • Addition
  • Subtraction
  • Division
  • Multiplication
  • General Formula
  • Area of a Triangle
  • Area of a Square
  • Cubic Volume
  • Cuboid Volume
  • Perimeter of a Parallelogram
  • Perimeter of a Trapezoid

Usage

Mathematical-pkg can be used in the browser.

Install mathematical-pkg using npm:

npm install mathematical-pkg

Example of Usage

import {
  sum, 
  rest, 
  divide, 
  multiply, 
  GeneralOperation, 
  triangleArea, 
  squareArea, 
  cubicVolume, 
  cuboidVolume, 
  parallelogramPerimeter, 
  trapezoidPerimeter
} from 'mathematical-pkg';

// basic operations
sum(2, 2);                       // 4
rest(5, 3);                      // 2
divide(12,2);                    // 6
multiply(4,5);                   // 20


// GeneralOperation
GeneralOperation(6,-19,7);       // [ -0.4256296675458497, -2.741036999120817 ]


// Areas
triangleArea(3, 4);              // 6
squareArea(2, 2);                // 4

// Volumes
cubicVolume(3);                  // 27
cuboidVolume(10, 4, 5);          // 220

// Perimeters 
parallelogramPerimeter(8, 7);    // 30
trapezoidPerimeter(5, 6, 5, 8);  // 24

Documentation

Browser support

Math.js works on any ES6 compatible JavaScript engine, Chrome, Firefox, Safari, and Edge.

Build

First clone the project from github:

git clone https://github.com/catalinafs/mathematical-pkg.git
cd mathematical-pkg

Install the project dependencies:

npm install or npm i

Develop

When developing new features for mathematical-pkg, it is good to be aware of the following background information.

Code

The code of mathematical-pkg is written in ES modules, and requires all files to have a real, relative path, meaning the files must have a *.js extension. Please configure adding file extensions on auto import in your IDE.

Test

To execute tests for the library, install the project dependencies once:

npm install

Then, the tests can be executed:

npm test

Have some fun with the package!!!

And a little bit of good luck, just saying.