@jobuntux/psgc
Philippine Standard Geographic Code (PSGC) for JavaScript and TypeScript projects. Easily query regions, provinces, municipalities, and barangays with clean utilities and structured data.
Installation
bash
npm install @jobuntux/psgcor
bash
yarn add @jobuntux/psgcQuick Example
typescript
import {
listRegions,
listProvinces,
listMuncities,
listBarangays
} from '@jobuntux/psgc'
// list all regions
console.log(listRegions())
// list provinces and HUCs in Region III (Central Luzon)
console.log(listProvinces('03'))
// list municipalities in Bulacan
console.log(listMuncities('03014'))
// list barangays in Malolos City
console.log(listBarangays('01410'))Documentation
Fig 1. This package adheres to the PSGC Revision 1 NEW CODING STRUCTURE.
Features
- 🌏 Complete PSGC dataset (regions, provinces, municipalities, barangays)
- ⚡ Fast lookups with prebuilt JSON
- 📦 Lightweight and tree-shakable
- 🧪 Tested utilities with predictable outputs
- 🛠 Works in Node.js, browser, and modern frameworks
FAQ
See FAQs here