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 🙏

© 2026 – Pkg Stats / Ryan Hefner

isxxxx

v1.0.10

Published

Lightweight library for checking number properties and mathematical classifications

Readme

isxxxx

npm version MIT License

Lightweight library for checking number properties and mathematical classifications.

Installation

npm install isxxxx
# or
yarn add isxxxx
# or
pnpm add isxxxx

Usage

// Import specific functions
const { isEven, isPrime, isHappy } = require('isxxxx');

// Or import everything
const isxxxx = require('isxxxx');

// Examples
isEven(4);        // true
isPrime(17);      // true
isFibonacci(8);   // true
isHappy(19);      // true

Available Functions

Basic Properties

  • isEven(num) - Checks if number is even
  • isOdd(num) - Checks if number is odd
  • isPositive(num) - Checks if number is positive
  • isNegative(num) - Checks if number is negative
  • isZero(num) - Checks if number is zero
  • isInteger(num) - Checks if number is an integer
  • isSafeInteger(num) - Checks if number is a safe integer in JavaScript
  • isInRange(num, min, max) - Checks if number is within range (inclusive)

Mathematical Properties

  • isPrime(num) - Checks if number is prime
  • isPerfectSquare(num) - Checks if number is a perfect square
  • isMultipleOf(num, multiple) - Checks if number is a multiple of another
  • isPowerOfTwo(num) - Checks if number is a power of two
  • isPowerOf(num, base) - Checks if number is a power of a given base
  • isSquareFree(num) - Checks if number has no squared prime factors

Special Sequences

  • isFibonacci(num) - Checks if number is in the Fibonacci sequence
  • isLucas(num) - Checks if number is in the Lucas sequence
  • isCatalan(num) - Checks if number is a Catalan number
  • isBell(num) - Checks if number is a Bell number
  • isTriangular(num) - Checks if number is triangular (1+2+3+...)
  • isPentagonal(num) - Checks if number is pentagonal
  • isHexagonal(num) - Checks if number is hexagonal
  • isFactorial(num) - Checks if number is a factorial (n!)
  • isRepunit(num) - Checks if number consists only of 1s
  • isPronic(num) - Checks if number is pronic (n*(n+1))

Named Numbers

  • isMersennePrime(num) - Checks if number is a Mersenne prime (2^n-1)
  • isFermat(num) - Checks if number is a Fermat number (2^(2^n)+1)
  • isCullen(num) - Checks if number is a Cullen number (n*2^n+1)
  • isWoodall(num) - Checks if number is a Woodall number (n*2^n-1)
  • isKaprekar(num) - Checks if number is a Kaprekar number
  • isArmstrong(num) - Checks if number equals sum of its digits each raised to power of number of digits
  • isNarcissistic(num) - Alias for isArmstrong
  • isHappy(num) - Checks if a number is "happy" (process leads to 1)
  • isHarshad(num) - Checks if number is divisible by sum of its digits
  • isSmith(num) - Checks if digit sum equals digit sum of prime factors
  • isApocalyptic(num) - Checks if 2^n contains "666"

Number Classifications

  • isPerfect(num) - Checks if number equals sum of its proper divisors
  • isAbundant(num) - Checks if number is less than sum of proper divisors
  • isDeficient(num) - Checks if number is greater than sum of proper divisors
  • isPowerful(num) - Checks if all prime factors also divide as squares
  • isPractical(num) - Checks if every smaller number is sum of distinct divisors
  • isSelfNumber(num) - Checks if number cannot be generated as n+sum(digits(n))
  • isAutomorphic(num) - Checks if square ends with the number itself
  • isPalindrome(num) - Checks if number reads the same forward and backward
  • isAlternating(num) - Checks if digits alternate between odd and even
  • isUndulant(num) - Checks if digits rise and fall alternately
  • isCarmichael(num) - Checks if number satisfies Fermat's little theorem

Error Handling

All functions validate inputs and throw appropriate errors:

// Throws TypeError: Expected a number
isEven('not a number');

// Throws TypeError: Expected numbers
isMultipleOf('ten', 5);

// Throws Error: Cannot check for multiples of zero
isMultipleOf(10, 0);

License

MIT © Alexander KOP