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

jp-address-romaji

v0.1.8

Published

Bidirectional conversion between Japanese and romanized (international) addresses. Runs fully offline: address data never leaves your machine.

Readme

jp-address-romaji

npm CI License: MIT Node.js 18+ module: ESM only no network at runtime in Node browser: bring your own endpoint

Bidirectional conversion between Japanese addresses and their romanized, western-order equivalents.

Addresses are personal data, so this library never sends them anywhere. There is no hosted API. It reads a local copy of the address dataset and, by default, makes no network requests at all — enforced by a test that replaces fetch with a stub that throws.

npm install jp-address-romaji jp-address-romaji-data

Requirements

Read these before installing — they are the conditions that fail after npm install, not during it:

  • ESM only. package.json is "type": "module" and the exports map has no require condition, so require('jp-address-romaji') does not work. CJS support is out of scope for now.
  • Node.js 18+, where the dataset is read from the filesystem. Browsers are supported through the browser export condition, but a page has no filesystem: you serve the data yourself and point the library at it. See In the browser.
  • The dataset package is required. jp-address-romaji-data is a separate install (above); without it every conversion fails with DATA_NOT_CONFIGURED rather than silently going to the network.
  • Version 0.x — the API may still change between minor releases. This is a personal project maintained on a best-effort basis.
import { toRomaji, fromRomaji } from 'jp-address-romaji';

await toRomaji('東京都新宿区西新宿二丁目8番1号');
// → { ok: true, value: { formatted: '2-8-1 Nishishinjuku, Shinjuku-ku, Tokyo, Japan', … } }

await fromRomaji('2-8-1 Nishishinjuku, Shinjuku-ku, Tokyo 160-0023');
// → { ok: true, value: { formatted: '東京都新宿区西新宿二丁目8-1', … } }

In the browser

Any bundler that honours export conditions picks the browser entry point automatically; the API is identical. A page has no filesystem, so the dataset comes from an endpoint you serve:

import { configureDataSource, toRomaji } from 'jp-address-romaji';

configureDataSource({ endpoint: 'https://your-site.example/address-data/ja' });
await toRomaji('東京都新宿区西新宿二丁目8番1号');

The library reads <endpoint>.json for the prefecture/municipality index and <endpoint>/<prefecture>/<municipality>.json for the towns of the one municipality it needs. Build the files with npx jp-address-romaji-data build --out ./address-data and serve them statically.

Be precise with your users about what this guarantees. The municipality request puts the prefecture and the municipality in a URL on your server. The block number, building name and addressee are matched inside the page and never sent anywhere — but that is a weaker promise than the Node path, where nothing leaves the process at all. configureDataSource({ dataDir }) cannot work in a browser and refuses rather than approximating: conversions return DATA_NOT_CONFIGURED.

What it does and does not do

Address normalization is delegated entirely to @geolonia/normalize-japanese-addresses. This package implements the layer above it: romanization, word order, reverse lookup, and output formats for Google libaddressinput, Shopify and Stripe.

It never invents readings. Every romanization comes from the dataset — its romaji field, or its kana reading transliterated deterministically. When neither is available the API returns an explicit failure rather than a plausible guess. Failures are returned as values, not thrown, so the compiler makes you handle them.

Coverage over the 638,567 town entries of the shipped dataset is 99.55%, and 99.99% for chome-bearing urban addresses.

Building names and room numbers are isolated as unparsed and passed through untouched — never translated or romanized.

Documentation

Full documentation, the coverage report, the failure-reason table and the list of unsupported cases (Kyoto street-name addresses, geocoding accuracy) are in the repository:

https://github.com/tomatomerde/jp-address-romaji

日本語版: README.ja.md

Data source and disclaimer

Derived from the Japanese Digital Agency's アドレス・ベース・レジストリ, processed and published by Geolonia (MIT). Full attribution is in ATTRIBUTION.md.

The software is MIT licensed and provided "AS IS". What it guarantees is the refusal: when a reading is unavailable or a romanization is ambiguous, it returns a typed failure instead of a guess. It does not guarantee that a conversion it does return is correct for your purpose — verify before printing a shipping label or filing anything official.