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

utility-pro

v1.0.3

Published

NPM package for some utility functions to make your coding easy :)

Downloads

7

Readme

utility-pro

NPM package which provides some utility functions to make your coding easy :)

command to Install :

npm install utility-pro --save

list of functions contain in this package :

  • sum() : To calculate sum of all the numbers in array
  • sortNumber() : To sort array of number
  • removeDup() : To remove duplicate elements from array
  • removeDupAndSort() : To remove duplicate elements from array of number and sort it
  • isEven() : To check if every element of array is even number or not
  • isPrime() : To check if given number is prime or not
  • isNull() : To check if given variable is null or not
  • isUndefined() : To check if given variable is undefined or not
  • createRandomEmail() It will create a random email for you
  • createRandomWord() It will create a random word of desire number of alphabet for you
  • createRandomPhoneNumber() It will create a random phone number for you
  • createRandomURL() It will create a random url of desire length for you
  • createRandomIP() It will create a random IPv4 for you

Example:

const utilPro = require('utility-pro');
const a;
const arr = [3,2,4,4,2,1,7,5,9,4];
console.log(utilPro.sum(arr)); // 41
console.log(utilPro.sortNumber(arr)); // [ 1, 2, 2, 3, 4, 4, 4, 5, 7, 9 ]
console.log(utilPro.removeDup(arr)); // [ 3, 2, 4, 1, 7, 5, 9 ]
console.log(utilPro.removeDupAndSort(arr)); // [ 1, 2, 3, 4, 5, 7, 9 ]
console.log(utilPro.isEven([2,3,4,5])); //false
console.log(utilPro.isEven([2,6,4,8])); //true
console.log(utilPro.isPrime(5)); // true
console.log(utilPro.isPrime(4)); // false
console.log(utilPro.isNull(a)); // false
console.log(utilPro.isUndefined(a));// true
console.log(utilPro.createRandomEmail());// [email protected]
console.log(utilPro.createRandomWord(5));// efedb
console.log(utilPro.createRandomPhoneNumber());// 8995359431
console.log(utilPro.createRandomURL(5));// www.sdasd.com
console.log(utilPro.createRandomIP());// 192.168.1.50

more functions will be added in future.. stay tuned.. :)