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 🙏

© 2025 – Pkg Stats / Ryan Hefner

algorix

v1.0.3

Published

mathematics package

Downloads

7

Readme

algorix

algorix is a versatile JavaScript utility package that provides a collection of useful functions for common algorithmic tasks. This package can be used in both Node.js and browser environments and supports both CommonJS (require) and ES Modules (import) syntax.

Installation

You can install Algorix via npm:

  npm install algorix

Usage

const algoObject = require('algorix');
or
import {algoObject} from 'algorix';

functions

  1. percentegeChange(oldValue, newValue)
console.log(algoObject.percentegeChange(50, 75));   // Output: "50%"
console.log(algoObject.percentegeChange(0, 100));   // Output: "Infinity"
console.log(algoObject.percentegeChange(100, 50));  // Output: "-50%"
console.log(algoObject.percentegeChange(0, 0));     // Output: "Infinity"
  1. factor(num )
console.log(algoObject.factor(12));  // Output: [1, 2, 3, 4, 6, 12]
console.log(algoObject.factor(7));   // Output: [1, 7]
console.log(algoObject.factor(0));   // Output: undefined
console.log(algoObject.factor(-5));  // Output: undefined
console.log(algoObject.factor("abc")); // Output: undefined
  1. randRange(min, max)
console.log(algoObject.randRange(1, 10));       // Output: Random integer between 1 and 10
console.log(algoObject.randRange(1, 10, 1));    // Output: Random float between 1 and 10
console.log(algoObject.randRange(10, 1));       // Output: "Invalid"
console.log(algoObject.randRange(1, 1));        // Output: "Invalid"
console.log(algoObject.randRange(-5, 5));       // Output: Random integer between -5 and 5
console.log(algoObject.randRange(-5, -1));      // Output: Random integer between -5 and -1
  1. randInsert(length)
console.log(algoObject.randInsert(5));  // Output: Random 5-digit number
console.log(algoObject.randInsert(5, [{ index: 1, value: 9 }, { index: 3, value: 7 }]));  // Output: Random 5-digit number with fixed digits
console.log(algoObject.randInsert(6, [{ index: 2, value: 5 }]));  // Output: Random 6-digit number with 5 at index 2

  1. isPrime(a)
console.log(algoObject.isPrime(7));   // Output: true
console.log(algoObject.isPrime(10));  // Output: false
console.log(algoObject.isPrime(1));   // Output: false
console.log(algoObject.isPrime(13));  // Output: true

  1. reverse(a)
console.log(algoObject.reverse(123));      // Output: 321
console.log(algoObject.reverse("hello"));  // Output: "olleh"
console.log(algoObject.reverse([1, 2, 3])); // Output: [3, 2, 1]
console.log(algoObject.reverse(null));     // Output: "Invalid"
console.log(algoObject.reverse({}));       // Output: "Invalid"

License

MIT