A JavaScript library for querying administrative regions in Cambodia including Provinces, Districts, Communes and Villages.
Supports Node.js, Browser and Deno.
Forked from kruyvanna/node-pumi
npm i pumi
ESM
import { provinces, districts, communes, villages, all } from "pumi";
CommonJS
const { provinces, districts, communes, villages, all } = require("pumi");
ESM
import provinces from "pumi/provinces";
import districts from "pumi/districts";
import communes from "pumi/communes";
import villages from "pumi/villages";
CommonJS
const provinces = require("pumi/provinces");
const districts = require("pumi/districts");
const communes = require("pumi/communes");
const villages = require("pumi/villages");
import {
provinces,
districts,
communes,
villages,
all,
} from "https://unpkg.com/pumi@latest/dist/main.mjs";
// Or
const {
provinces,
districts,
communes,
villages,
all
} = await import(
"https://unpkg.com/pumi@latest/dist/main.mjs"
);
export interface LocalizedName {
km: string;
latin: string;
}
export interface AdministrativeUnit extends LocalizedName {
en: string;
}
export interface AdministrativeDivision {
id: string;
name: LocalizedName;
unit: AdministrativeUnit;
parent?: string;
}