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

@berriz44/mathext

v1.0.3-readme

Published

[![Maintenance](https://img.shields.io/badge/Maintained%3F-yes-green.svg)](https://github.com/the-one-with-raspberry/mathext) [![GitHub last commit (master)](https://img.shields.io/github/last-commit/the-one-with-raspberry/mathext/master)](https://github

Downloads

2

Readme

mathext

Maintenance GitHub last commit (master) GitHub issues npm GitHub Repo stars npm bundle size

mathext is an extension of the math interface in JavaScript.

how to install:

npm install @berriz44/mathext

usage:

const MathExt = require('@berriz44/mathext')

items

MathExt.numberRow: number | string | Array<number>

description:

makes a row of numbers

arguments:

  1. end: number | to what number should it count
  2. start: number | what number should it start with. defaults to 1.
  3. step: number | how much to increment each number. defaults to 1. affected by start and end.
  4. datatype: number | string | Array<any> | can be any number, array or string. defaults to array. determines the return type of the function.

returns:

a number, string, or Array<number> representing a row of numbers

examples:

MathExt.numberRow(10, 1)
// [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
typeof MathExt.numberRow(10, 1)
/// Array<number>
MathExt.numberRow(11, 1, 2)
// [1, 3, 5, 7, 9, 11]
MathExt.numberRow(10, 1, 1, "")
// "12345678910"
typeof MathExt.numberRow(10, 1, 1, "")
// 'string'
MathExt.numberRow(10, 1, 1, 0)
// 12345678910
typeof MathExt.numberRow(10, 1, 1, 0)
// 'number'

MathExt.isPositive: boolean

description:

says if a number is positive or not

arguments:

i: number | which number to know whether it is positive or negative

returns:

true if i is positive, false if i is negative

examples:

MathExt.isPositive(77)
// true
MathExt.isPositive(-24)
// false

examples:

MathExt.infinity: number

description:

returns infinity or negative infinity based on a parameter

arguments:

side: number | any number. affects the return value.

returns:

infinity if side is a positive number and -infinity if side is a negative number

examples:

MathExt.infinity(1)
// Infinity
MathExt.infinity(-1)
// -Infinity

MathExt.turnStringArrayToNumberArray: Array<number>

description:

turns a string array into a number array

arguments:

arr: Array<string> | the array to convert

returns:

an Array<number> with numbers from the arr parameter

examples:

MathExt.turnStringArrayToNumberArray(["10", "4", "9", "fffg"])
// [10, 4, 9, NaN]