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

is-x-js

v0.1.1

Published

JavaScript implementation of is-x

Readme

is-x-js

A flexible and fun JavaScript library for number comparison and manipulation.

Installation

npm install is-x-js

Basic Usage

const { is } = require("@is-x/js");

// Set a target number
is(20).setX();

// Basic comparisons
is(20).isX(); // true
is(21).isX(); // false
is(21).isNotX(); // true

Features

Math Operations

// Basic Math
is(15).plus(5).isX(); // true (15 + 5 = 20)
is(25).minus(5).isX(); // true (25 - 5 = 20)
is(10).times(2).isX(); // true (10 * 2 = 20)
is(40).dividedBy(2).isX(); // true (40 / 2 = 20)

// Chain operations
is(10).plus(5).times(2).minus(10).isX(); // true (10 + 5 = 15, *2 = 30, -10 = 20)

// Advanced Math
is(4).squared(); // squares the number
is(400).squareRoot(); // square root
is(2).power(4); // raises to power
is(8000).root(3); // nth root
is(100).modulo(80); // modulo operation
is(-20).absolute(); // absolute value
is(3).factorial(); // factorial

Approximate Comparisons

// Different levels of approximation
is(19.9).roughly.isX(); // true (within 0.2 units)
is(19.5).approximately.isX(); // true (within 0.5 units)
is(18).almostX(); // true (within 2 units)
is(17).within(3).of.isX(); // true (within 3 units)

Number System Conversions

// Convert from different number systems
is("10100").inBinary.of.isX(); // true (10100 binary = 20)
is("14").inHex.of.isX(); // true (14 hex = 20)
is("24").inOctal.of.isX(); // true (24 octal = 20)
is("2e1").inScientificNotation.of.isX(); // true (2e1 = 20)

Text Representations

// Text and special formats
is("twenty").inWords.of.isX(); // true
is("XX").inRoman.of.isX(); // true (XX = 20)
is("..---").inMorse.of.isX(); // true (for 2)
is("42O").inLeetSpeak.of.isX(); // true (for 420)

Number Properties

Check properties of target number using is.X:

// Mathematical properties
is.X.isPerfectSquare(); // checks if perfect square
is.X.isPrime(); // checks if prime
is.X.isFibonacci(); // checks if Fibonacci number
is.X.isEven(); // checks if even
is.X.isOdd(); // checks if odd
is.X.isDivisibleBy(4); // checks divisibility
is.X.hasFactors(); // returns all factors
is.X.isMultipleOf(5); // checks if multiple

Special Checks

// Time-based
is.X.isCurrentHour(); // compares with current hour
is.X.isCurrentYear(); // compares with current year

// Fun checks
is.X.isAnswerToLife(); // checks if 42
is.X.isUnlucky(); // checks if 13
is.X.isDiceRoll(); // checks if valid dice number (1-6)
is.X.isCardNumber(); // checks if valid card number (1-13)
is.X.isPokemonNumber(); // checks if valid Pokémon number (1-898)

Error Handling

The library includes proper error handling for invalid operations:

  • Division by zero
  • Invalid square roots (negative numbers)
  • Invalid factorials (negative numbers or non-integers)
  • Invalid root calculations

License

ISC

Related Packages

Check out our multi-language installer:

npm install -g is-x-installer

is-x-js

A flexible and fun JavaScript library for number comparison and manipulation.

Installation

npm install @is-x/js

Basic Usage

const { is } = require("@is-x/js");

// Set a target number
is(20).setX();

// Basic comparisons
is(20).isX(); // true
is(21).isX(); // false
is(21).isNotX(); // true

Features

Math Operations

// Basic Math
is(15).plus(5).isX(); // true (15 + 5 = 20)
is(25).minus(5).isX(); // true (25 - 5 = 20)
is(10).times(2).isX(); // true (10 * 2 = 20)
is(40).dividedBy(2).isX(); // true (40 / 2 = 20)

// Chain operations
is(10).plus(5).times(2).minus(10).isX(); // true (10 + 5 = 15, *2 = 30, -10 = 20)

// Advanced Math
is(4).squared(); // squares the number
is(400).squareRoot(); // square root
is(2).power(4); // raises to power
is(8000).root(3); // nth root
is(100).modulo(80); // modulo operation
is(-20).absolute(); // absolute value
is(3).factorial(); // factorial

Approximate Comparisons

// Different levels of approximation
is(19.9).roughly.isX(); // true (within 0.2 units)
is(19.5).approximately.isX(); // true (within 0.5 units)
is(18).almostX(); // true (within 2 units)
is(17).within(3).of.isX(); // true (within 3 units)

Number System Conversions

// Convert from different number systems
is("10100").inBinary.of.isX(); // true (10100 binary = 20)
is("14").inHex.of.isX(); // true (14 hex = 20)
is("24").inOctal.of.isX(); // true (24 octal = 20)
is("2e1").inScientificNotation.of.isX(); // true (2e1 = 20)

Text Representations

// Text and special formats
is("twenty").inWords.of.isX(); // true
is("XX").inRoman.of.isX(); // true (XX = 20)
is("..---").inMorse.of.isX(); // true (for 2)
is("42O").inLeetSpeak.of.isX(); // true (for 420)

Number Properties

Check properties of target number using is.X:

// Mathematical properties
is.X.isPerfectSquare(); // checks if perfect square
is.X.isPrime(); // checks if prime
is.X.isFibonacci(); // checks if Fibonacci number
is.X.isEven(); // checks if even
is.X.isOdd(); // checks if odd
is.X.isDivisibleBy(4); // checks divisibility
is.X.hasFactors(); // returns all factors
is.X.isMultipleOf(5); // checks if multiple

Special Checks

// Time-based
is.X.isCurrentHour(); // compares with current hour
is.X.isCurrentYear(); // compares with current year

// Fun checks
is.X.isAnswerToLife(); // checks if 42
is.X.isUnlucky(); // checks if 13
is.X.isDiceRoll(); // checks if valid dice number (1-6)
is.X.isCardNumber(); // checks if valid card number (1-13)
is.X.isPokemonNumber(); // checks if valid Pokémon number (1-898)

Error Handling

The library includes proper error handling for invalid operations:

  • Division by zero
  • Invalid square roots (negative numbers)
  • Invalid factorials (negative numbers or non-integers)
  • Invalid root calculations

License

ISC

Related Packages

Check out our multi-language installer:

npm install -g is-x-installer