Reference · Japanese addresses
findMunicipalitiesByNamefunction
The municipalities a Japanese name could mean: several when the name is shared (府中市 is in Tokyo and in Hiroshima).
A town or village may be named without its district (当別町).
Import it
import { findMunicipalitiesByName } from "@johnmorrisdotca/address-plus/jp";
Also exported from: @johnmorrisdotca/address-plus
Definition
function findMunicipalitiesByName(name: string, prefectureCode?: string): JapaneseMunicipality[]
Parameters
| Name | Type | Description |
|---|---|---|
name | string | The municipality's name in Japanese. |
prefectureCode (optional) | string | undefined | A prefecture's JIS code, to look in that prefecture only. |
Returns
JapaneseMunicipality[]
Every match, an empty array when there is none.
Examples
import { findMunicipalitiesByName } from "@johnmorrisdotca/address-plus/jp";
console.log(findMunicipalitiesByName("府中市").map((one) => one.code + " " + one.romaji));
// → ["13206 Fuchu-shi","34208 Fuchu-shi"][ '13206 Fuchu-shi', '34208 Fuchu-shi' ]What it prints (run when this page was built)