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

math-in-one

v1.0.2

Published

This npm package provide all the possible feature inside math operation

Downloads

6

Readme

math-in-one PRs Welcome

Introduction

This package includes the following functionalities🐻

  • Sum: This method can take multiple parameter or Array and return sum of all numbers or digits of array.

  • Product: This method can take multiple parameter or Array and return product of all numbers or digits of array.

  • Random Text: This method can take 4 parameter and return random text. Bydefault it return random digits of 6 length.

  • Average: This method can take multiple parameter or Array and return product of all numbers or digits of array.

  • Flatten Array: This method can take a nested array and return 1-D array.

Installation

npm install math-in-one

OR

npm i math-in-one

Usage Guidelines

   import Maths from 'math-in-one'

Random Text

To generate random text call method randomtext()

randomtext(length,alphaNumeric,allowUppercase,allowLowercase,alpha)

If no parameter pass in above method then it will return 6 digit of random text. It accept 4 parameter :-

length :- Length of random text accepted. Default (6)

alphaNumeric :- If need to generate alphaNumeric text then proivde it true. Default (false)

allowUppercase :- If need to generate character in upper case proivde it true. Default (false)

allowLowercase :- If need to generate character in lower case proivde it true. Default (false)

alpha :- If need to generate only character proivde it true. Default (false)

It will return Number/ AlphaNumeric/ Alphabet..

TABLE

| Argument As Input | Input String Example | Description | Default |:------:|:------:|:--:|:---:| | length | 5 | This is for generating random text of length {12395} | 6| | alphaNumeric | true | This is for genereating alphanumeric {12gf9} | false| | allowUppercase | true | This is for generate characters in upprecase {12GF9} | false| | allowLowercase |true | This is for generate characters in upprecase {12gf9} |false | | alpha |true | This is for generate only characters |false |

Examples :-

Sum:


console.log(Maths.sum(8,2,3,4,5));
// output :- 22

Maths.sum([8,2,3,4,5[);
// output :- 22

Product:


console.log(Maths.product(8,2,3,4,5));
// output :- 960

console.log(Maths.sum([8,2,3,4,5]));
// output :- 960

Random Text:


Maths.randomtext(8,true,true,true,false)
// output :- QMIV2AHV

Average:


console.log(Maths.average(1, 2, 3, 4));
// output :- 10

console.log(Maths.average([1, 2, 3, 4]));
// output :- 10

Flatten:


console.log(Maths.flatten([1,[2,[23,34,[5,6,7,8]], 4]]));

// output :- [
  1, 2, 23, 34, 5,
  6, 7,  8,  4
]

Build

npm run build

Contribute

If you would like to contribute your most welcome. Clone the repository. 🐻