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

@readable-code/english

v0.1.3

Published

English-like pronounceable word generator for readable share codes.

Readme

@readable-code/english

English-like pronounceable word generator for readable-code share codes.

Generates easy-to-read, easy-to-say pseudo-words — not dictionary words, not secret tokens.

Install

npm install @readable-code/english

Usage

import { word } from "@readable-code/english";

word(4).dash().digits(4).build();
// "mivo-4821"

word(4).dash().word(8).dash().digits(4).build();
// "teva-pifoluna-7520"

build() is the finalizer. It joins the chained fragments and returns the code string.

How words are generated

English-like codes use pseudo-words rather than a dictionary. The generator alternates consonants and vowels into a pronounceable shape:

consonant + vowel + consonant + vowel  →  mivo, rane, coru

Ambiguous letters (q, x, y) are excluded.

API

word(length, options?)

Primary fluent API. Returns a builder with one pseudo-word already added, so you can keep chaining.

word(6).build();              // "mivora"
word(4, { casing: "upper" }); // "MIVO..."

Builder methods: word(length), dash(), digits(length) / nums(length), add(value), build(), toString().

engWord(length, options?) => string

Lower-level helper that generates one pseudo-word and returns it as a plain string — no builder, no chaining, no separators or digits attached. Where word() starts a fluent chain, engWord() is the raw primitive underneath it: word(n) is essentially code().add(engWord(n)).

Reach for engWord() when you want the bare word to drop into your own composition — a custom template, an existing string, a non-CodeBuilder pipeline, or when you only need the word itself with no suffix.

import { engWord } from "@readable-code/english";

engWord(4);                      // "mivo"
engWord(6, { casing: "upper" }); // "MIVORA"
engWord(0);                      // "" — length 0 yields an empty string

Compose it manually via the core builder, or just use plain string ops:

import { code } from "@readable-code/core";
import { engWord } from "@readable-code/english";

// Equivalent to word(4).dash().digits(4)
code().add(engWord(4)).dash().digits(4).build();

// Or your own format, no builder at all:
`order-${engWord(5)}`;           // "order-teruk"

Parameters

  • length (number, required) — number of characters. Must be a non-negative integer; odd lengths still start on a consonant (engWord(1) → one consonant). Throws RangeError otherwise.

Options

  • casing?: "lower" | "upper" — output case. Defaults to lower. Applies to the generated letters only.
  • random?: RandomSource — custom random source from @readable-code/core for deterministic output (see below). Defaults to secureRandom (crypto.getRandomValues).

Deterministic output

Pass a custom RandomSource from @readable-code/core for reproducible tests:

import { type RandomSource } from "@readable-code/core";
import { word } from "@readable-code/english";

const random: RandomSource = () => 0;
word(4, { random }).dash().digits(4).build();

Concept

Readable public share codes, not secret tokens. Keep uniqueness separate from the readable part — store codes under a database UNIQUE constraint and retry on collision.

License

MIT