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

stuffed-naan

v1.0.5

Published

Stuff your Na(a)Ns

Downloads

9

Readme

license: MIT/ NPM Version

Stuffed-Na(a)N: stuff your NaNs

A photo of a garlic naan

Joy via Wikimedia

Have you ever done this by mistake?

console.log(0 / 0)
// Output: NaN

Or maybe this?

console.log(Math.asin(2))
// Output: NaN

Have you been annoyed by NaN propagation?

const a = NaN
console.log((a * 2) - 5)
// Output: NaN

With stuffed-naan, you can finally make use of NaNs. Just stuff ~~NaN~~ Na(a)Ns with your data!

import { encode, decode } from 'stuffed-naan';

const encoded = encode("Hello world");
console.log(encoded);
// Output: [NaN, NaN, NaN]

console.log(decode(encoded));
// Output: Hello world

To quote Sun Tzu, "If you can't beat the enemy, use the enemy's advantage to your advantage". Na(a)Ns preserve data even when used in mathematical operations:

import { encode, decode } from 'stuffed-naan';

const encoded = encode("Hello world");
console.log(decode(encoded.map(x => x * 2)));
// Output: Hello world

Why stuffed-naan

Compact 💿

stuffed-naan is compact. Community Edition achieves a compression ratio of -25%. That means, for every 1024 bytes of data, you get 1368 bytes of float64 Na(a)Ns back! This is an industry-beating level of Na(a)N compression. For even better compression, consider the Enterprise Edition.

Blazing fast 🚀

stuffed-naan is blazing fast. Thanks to advanced byte-manipulation capabilities available in ECMAScript® 2026, the overhead of stuffing is minimal. Na(a)Nification of a thousand small objects takes 1–3ms.

Privacy-first 🚫👀

stuffed-naan is privacy-first. It's a first-of-its-kind privacy-preserving encoding, since an array of Na(a)Ns can't be copypasted without losing the information. This makes stuffed-naan indispensable to protect your customers' PII. Contact stuffed-naan DPO to learn more.

Installation

npm install stuffed-naan

Or you can do this in your browser console:

const stuffedNaan = await import('https://unpkg.com/stuffed-naan');
stuffedNaan.encode("hello world");

Enterprise Edition 🏦

Enterprise Edition includes:

  • ✅ 6% more efficient encoding
  • ✅ Support for big-endian processors, such as IBM zSeries
  • ✅ A dedicated Customer Success Manager

Contact sales for pricing.

Roadmap

  • ⚠️ Public benchmark history
  • ⚠️ Fuzzing
  • ⚠️ Rewrite in Rust
  • ⚠️ Formal verification with Kani

No but seriously

JS numbers are IEEE 754 floating point numbers, 64-bit long. They consist of a sign bit, an exponent, and a mantissa.

Here's how it all looks like in memory:

Memory layout of a float64 from Wikipedia

When mathematical operations on floats are applied incorrectly (for example, 0/0), the result is a special value called Not a Number, or NaN for short. NaNs are represented as floating point numbers with the exponent set to all 1s and at least one non-zero bit in the fraction part.

Which means I can commit crimes and smuggle data in the fraction part. IEEE is not going to stop me!

This trick is silly, but it works. Naturally, I couldn't resist overdoing the naan pun.

Support your local curry house! (Or, better yet, Come Back Alive)

Bluesky / Twitter / Web