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

@ivangsm0/hehe

v2.0.1

Published

An ultra-lite, 100% WHATWG-compliant HTML entity encoder/decoder. Optimized for size and performance.

Readme

@ivangsm0/hehe 🚀

An ultra-lite, 100% WHATWG-compliant HTML entity encoder/decoder. Rewritten in TypeScript. Optimized for maximum performance and minimal footprint.

Formerly known as he, @ivangsm0/hehe has been completely modernized and ultra-optimized to break size and performance barriers while maintaining perfect compliance with the HTML specification.

✨ Key Improvements over he

| Metric | he v1.2.0 | @ivangsm0/hehe | Improvement | |:---|:---:|:---:|:---:| | Minified Bundle (ESM) | ~55 KB* | 36.48 KB | ~35% smaller | | Unpacked Package Size | 124.1 KB | 84.7 KB | 32% smaller | | Download Size (Packed) | 40.3 KB | 31.3 KB | 22% smaller | | Execution Performance | 225.8 ms | 65.9 ms | 3.4x faster | | Language | JavaScript (ES5) | TypeScript | Type-safe |

*Estimated minified size based on original source.


🛠 Installation

# Using Bun (Recommended)
bun add @ivangsm0/hehe

# Using NPM
npm install @ivangsm0/hehe

📖 Usage

Encoding

import hehe from '@ivangsm0/hehe';

// Basic encoding
hehe.encode('foo © bar');
// → 'foo © bar'

// Use named references
hehe.encode('foo © bar', { useNamedReferences: true });
// → 'foo © bar'

// Encode everything
hehe.encode('a', { encodeEverything: true });
// → 'a'

Decoding

import { decode } from '@ivangsm0/hehe';

// Standard decoding
decode('foo © bar');
// → 'foo © bar'

// Strict mode
decode('&#xZ', { strict: true });
// → Parse error!

Escaping (Security first)

import { escape } from '@ivangsm0/hehe';

escape('<img src="x" onerror="prompt(1)">');
// → '&lt;img src=&quot;x&quot; onerror=&quot;prompt(&#x60;1&#x60;)&quot;&gt;'

🚀 Why hehe?

@ivangsm0/hehe uses advanced computer science techniques to provide the smallest possible bundle without sacrificing compliance:

  1. Trie-based Regex Compression: We compress 2,000+ entity patterns into a prefix-tree (Trie) to generate a high-efficiency matching regex.
  2. Packed Strings: We store entity data in high-density strings with non-printable delimiters, eliminating JSON overhead.
  3. Dynamic Map Generation: We generate lookup maps at runtime during module initialization, keeping the wire size tiny.

⚖️ License

MIT License. Developed by Iván Salazar ([email protected]). Inspired by the original he by Mathias Bynens.