@riz007/thai-address-data
v0.1.4
Published
Canonical, normalized Thai address dataset derived from thailand-geography-json.
Maintainers
Readme
@riz007/thai-address-data
Canonical, normalized Thai address dataset derived from the MIT-licensed thailand-geography-json repository. This package is data + minimal helpers only.
Install
yarn add @riz007/thai-address-data
# or
npm install @riz007/thai-address-dataUsage (Vue / Nuxt)
import data, { buildMeta } from "@riz007/thai-address-data";
const firstRow = data[0];
const meta = buildMeta;You can also import the JSON directly:
import data from "@riz007/thai-address-data/data.json";Nuxt SSR tip (lazy import to reduce server memory overhead):
const data = (await import("@riz007/thai-address-data/data.json")).default;Data format
export type ThaiAddressRow = {
subdistrict: string;
district: string;
province: string;
zipcode: string; // always string
};Names are sourced from the upstream Thai-name fields (*NameTh) when available,
with English as a fallback. All text is trimmed, zipcodes are normalized to
5-digit strings where possible, duplicates are removed, and output is sorted by
province, district, subdistrict, zipcode.
Updating the upstream submodule
git submodule update --init --recursive
git submodule update --remote --merge vendor/thailand-geography-json
yarn buildAttribution
Data is derived from thailand-geography-json (MIT). See THIRD_PARTY_NOTICES.md for details.
