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

@mailwoman/codex

v9.1.0

Published

Per-address-system postal reference data + branded types (USPS street suffixes, US ZIP codes). Pure, zero-runtime-dep — the shared canonical home for postal-system primitives the parser, resolver, and synthesis layers all reach for.

Readme

@mailwoman/codex

Per-address-system postal reference data and branded types.

Every country's postal authority (USPS, La Poste, Deutsche Post, …) has its own conventions for what a postcode, a street suffix, or a unit designator looks like. @mailwoman/codex is the shared, dependency-free home for that reference knowledge, kept apart from the locale-agnostic tokenizer/solver in @mailwoman/core and from the training pipeline in @mailwoman/corpus.

The parser, the resolver, and the synthesis layer all reach for the same tables instead of each carrying their own copy.

import { us, fr, gb, de } from "@mailwoman/codex"

// USPS street suffix lookup
us.lookupStreetSuffix("PKWY") // → { primary: "Parkway", standard: "Parkway", ... }
us.lookupStreetSuffix("PKY") // → { primary: "Parkway", standard: "Parkway", ... }

// French postcode pattern
fr.postcodePattern // → /^\d{5}$/

// US ZIP code branded type
import { us } from "@mailwoman/codex"
const zip: us.ZipCode = "94043" // branded, not just string

Supported address systems

Each system is exposed as a namespace and as a subpath import:

import { us } from "@mailwoman/codex"
import { lookupStreetSuffix } from "@mailwoman/codex/us"

| System | Scope | | -------- | ------------------------------------------------------------------------------------ | | us | USPS street suffixes, directional abbreviations, ZIP code types, state abbreviations | | fr | La Poste postcode format, CEDEX conventions, département codes | | gb | Royal Mail postcode format, post town conventions | | de | Deutsche Post postcode format, Bundesland abbreviations | | ca | Canada Post postcode format, province abbreviations | | au | Australia Post postcode format, state abbreviations |

Cross-system utilities

import { candidateSystemsForPostcode } from "@mailwoman/codex"

// Which systems could "94043" belong to?
candidateSystemsForPostcode("94043") // → ["us"]
candidateSystemsForPostcode("75008") // → ["fr"]
candidateSystemsForPostcode("10115") // → ["de"]

// Address system conventions (forbidden tags, expected shapes, etc.)
import { ADDRESS_SYSTEM_CONVENTIONS, conventionsForSystem } from "@mailwoman/codex"

Design

  • Zero runtime dependencies. Pure TypeScript data tables — no database, no I/O, no network. Suitable for bundling into browser and edge environments.
  • Branded types. ZIP codes, postcodes, and abbreviations carry nominal types so the type system catches locale mismatches at compile time.
  • Single source of truth. The resolver, the decoder's convention masks, the corpus synthesis layer, and the matcher all import from @mailwoman/codex.

The normative tier (codex vs the libpostal dictionaries)

Mailwoman carries two closed-class vocabularies that overlap on purpose and must not be merged:

  • Codex is normative. USPS Pub-28 (and each system's equivalent) verbatim: the canonical word, every recognized variant, and the one preferred abbreviation. Its consumers are precision-shaped — corpus synthesis recipes, the eval harness's invariance transforms, and formatting (rendering N vs North requires knowing which form the authority prints).
  • The libpostal dictionaries (core/data/libpostal/dictionaries/, Pelias lineage) are descriptive: everything people actually write, including forms no authority recognizes (en/directionals.txt lists lower/upper/central). Their consumers are recall-shaped — evidence-lexicon curation laws, street decomposition for training gold, the street-morphology FST. See the README in that directory for the full consumer map and the four-tier curated-data layering.

Broadening codex with descriptive forms would corrupt formatting; narrowing the descriptive lists to normative forms would weaken the evidence guards. Different questions, different tables.

Related

License

AGPL-3.0-only