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

more-math

v1.0.2

Published

More Math Functions

Downloads

5

Readme

Path to file for index.html: "./node_modules/more-math/index.js"

  1. Math.permutate(str) takes a string as an argument and returns all possible combinations (warning. May fail on long strings)

  2. Math.avg(arr) takes an array as an argument and returns the average of all the values.

  3. Math.median(arr) takes an array as an argument and returns the median of all the values.

  4. deepCloneObj(obj) (non-MATH) Takes an object as an argument and returns a deep copy of that object.

  5. Math.flattenArray(arr) takes an array (flat or an array of arrays) and flattens it into a single array, no matter how nested.

  6. Math.deepArraySum(arr) takes an array (however nested) and returns the sum of all numbers in those arrays.

  7. Math.deepArrayProduct(arr) takes an array (however nested) and returns the product of all numbers in those arrays.

  8. Math.factorial(num) takes a number and returns the factorial value of that number

  9. Math.allEven(arr) takes an array (no matter how nested) and returns all of the even values as an array

  10. Math.allOdd(arr) takes an array (no matter how nested) and returns all of the odd values as an array

  11. Math.isPrime(num) takes a number and returns true if it is a prime number

12 Math.fibonacci(num) performs the fibonacci on a number

  1. Math.GCD(num1, num2) takes two numbers as an argument and finds the greatest common divisor between them.

  2. Math.farenheit(celsius) convert a temp in celsius to farenheit

  3. Math.celsius(farenheit) convert a temp in farenheit to celsius

  4. Math.cmToInches(cm) converts a value in centimeters to inches

  5. Math.inchToCentimeters(inch) converts a value in inches to centimeters

  6. Math.circleArea(radius) takes a radius of a circle and returns the area of that circle.

  7. Math.circlePerimeter takes a radius of a circle and returns the perimeter of that circle.

  8. Math.nRoot(base, nth) takes a base value and a root value, and returns that root of the base.

  9. Math.areaTriangle(base, height) takes a base and height value and returns the area of that triangle.

  10. Math.thousandsCommas(num) takes a number of returns that number with commas in the thousands spots(ex. 10000 => 10,000) (does not work with decimals)

  11. Math.milesToKilometers(miles) takes a number of miles and returns that value in Kilometers

  12. Math.KilometersToMiles(kilo) takes a number of kilometers and returns that value in miles