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

fast-is-english-word

v1.0.2

Published

Blazingly fast English word lookup using xor filters. 42M ops/s, 270 KB, zero dependencies.

Readme

fast-is-english-word

Blazingly fast English word lookup. ~42M ops/s, 555 KB on npm, zero runtime dependencies.

Works in Node.js, Bun, Deno, browsers, edge runtimes, and Cloudflare Workers — same import everywhere.

Uses an xor filter — a space-efficient probabilistic data structure that's smaller and faster than bloom filters. The entire 234k-word dictionary compresses into a 282 KB binary with only 3 array accesses per lookup.

Install

npm install fast-is-english-word

Usage

import { isWord } from "fast-is-english-word";

isWord("hello");     // true
isWord("world");     // true
isWord("asdfgh");    // false
isWord("Hello");     // true  (case-insensitive)
isWord("it's");      // false (alpha-only)

Works identically in Node.js, browser bundlers (webpack, vite, rollup), and edge runtimes. The right entry point is selected automatically via the package exports map.

Performance

| Benchmark | ops/s | ns/op | |-----------|------:|------:| | Known word ("algorithm") | 42,000,000 | 24 | | Non-word ("xjqkv") | 76,000,000 | 13 | | Short word ("a") | 140,000,000 | 7 | | Long word ("extraordinary") | 30,000,000 | 34 |

npm run bench

How it works

An xor filter stores 8-bit fingerprints in a compact array. For each query, 3 positions are computed and the XOR of those 3 entries is compared against the word's fingerprint.

  • Zero false negatives — if a word is in the dictionary, isWord always returns true
  • False positive rate ≈ 0.39% (xor8) — ~1 in 256 non-words may return true
  • O(1) lookup — exactly 3 array accesses, independent of dictionary size
  • 282 KB — vs ~2.5 MB for a raw word list, or ~36 MB for a Set

Platform support

| Environment | Entry | How it loads | |-------------|-------|-------------| | Node.js (ESM) | dist/index.js | readFileSync of binary filter | | Node.js (CJS) | dist/index.cjs | readFileSync of binary filter | | Browser / bundler | dist/browser.js | Self-contained, filter embedded as base64 | | Deno / edge / workers | dist/browser.js | Self-contained, no filesystem needed |

The correct entry is resolved automatically by the exports map — you always just write:

import { isWord } from "fast-is-english-word";

API

isWord(word: string): boolean

Returns true if word is a recognized English word.

  • Case-insensitive (lowercased internally)
  • Returns false for empty strings, numbers, hyphens, apostrophes, spaces
  • Only ASCII a–z characters are supported

Configuration

The filter is pre-built with xor8 by default (smallest size). You can rebuild with different options:

Fingerprint size

| Mode | FP rate | Filter size | |------|---------|------------| | xor8 (default) | ≈ 0.39% | 282 KB | | xor16 | ≈ 0.0015% | 563 KB |

# Rebuild with 16-bit fingerprints (higher accuracy, 2x size)
npm run build:filter:xor16
npm run build

Custom word list

# Use any newline-separated word list
node scripts/build-filter.mjs --words=./my-words.txt

# Combine options
node scripts/build-filter.mjs --bits=16 --words=./my-words.txt

npm run build

Comparison

| Package | Approach | Size | Lookup | |---------|----------|------|--------| | fast-is-english-word | Xor filter | 555 KB | 24 ns | | an-array-of-english-words | JSON array | 3.4 MB | ~ms (linear scan) | | word-list | Text file | 2.8 MB | user builds own | | check-if-word | Giant regex | 39.6 MB | slow |

License

MIT