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-number-rs

v0.2.1

Published

Finally, a WebAssembly-powered solution to the age-old question: is it a number?

Readme

is-number-rs

Because JavaScript's type coercion wasn't confusing enough, we decided to solve it with WebAssembly.

A blazingly fast, memory-safe, fearlessly concurrent way to check if a string is a number. Written in Rust, compiled to WASM, delivered to npm. The triforce of modern web development.

Why?

The JavaScript ecosystem has mass downloaded variations of is-number over 60 million times per week. Clearly, determining whether something is a number is one of humanity's greatest unsolved challenges.

We're here to mass download solutions.

This package brings the raw, unbridled power of Rust's parse::<f64>() to your node_modules. Finally.

Installation

npm install is-number-rs

Usage

With a bundler (Vite, webpack, Next.js, etc.)

Just import and use - the bundler handles WASM loading automatically:

import { is_number } from 'is-number-rs';

is_number("42");        // true - that's a number alright
is_number("3.14159");   // true - pi-ish
is_number("-273.15");   // true - absolute zero, absolutely a number
is_number("1e10");      // true - science!
is_number("Infinity");  // false - we have standards
is_number("NaN");       // false - we REALLY have standards
is_number("");          // false - the void is not a number
is_number("   ");       // false - neither is whitespace
is_number("abc");       // false - letters aren't numbers (controversial take)
is_number("12px");      // false - CSS units don't count

With Node.js (no bundler)

Node.js needs the experimental WASM modules flag:

node --experimental-wasm-modules your-script.js

Browser (via CDN)

Works in modern browsers with ES module support and a bundler, or via tools like esm.sh.

Features

  • Written in Rust (mass production ready)
  • Compiles to WebAssembly (buzzword compliant)
  • Handles edge cases (we trim whitespace!)
  • Rejects Infinity and NaN (because isFinite said so)
  • Zero runtime dependencies*

*^(in Rust)

Performance

Is it faster than a simple regex or parseFloat check in JavaScript?

Look, we didn't write this in Rust and compile it to WASM for it to be slower. That would defeat the entire purpose of...

Actually, we haven't benchmarked it. But it feels fast.

How It Works

pub fn is_number(value: &str) -> bool {
    let trimmed = value.trim();
    if trimmed.is_empty() {
        return false;
    }
    match trimmed.parse::<f64>() {
        Ok(n) => n.is_finite(),
        Err(_) => false,
    }
}

That's it. That's the whole thing. 13 lines of Rust doing what JavaScript has needed 60 million weekly downloads to figure out.

Compatibility

| Environment | Status | |-------------|--------| | Vite, webpack, Rollup, esbuild | Works out of the box | | Next.js, Nuxt, SvelteKit | Works out of the box | | Node.js | Requires --experimental-wasm-modules flag | | Bun | Not yet supported (Bun's WASM ESM loader is incompatible) | | Browsers (bundled) | Works out of the box |

Contributing

Found a number we're not recognizing? Open an issue. Found something that isn't a number that we think is? That's probably more concerning. Also open an issue.

License

MIT - Use it however you want. We're not responsible for any existential crises caused by questioning what a number really is.


Made with mass downloads and mass production in mind.