Skip to content

@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.

npmlicensenpm downloadsLast commitGitHub issuesGitHub Repo starsKnown Vulnerabilitiescode style: prettierTypeScript

Installation

bash
npm install @jobuntux/psgc

or

bash
yarn add @jobuntux/psgc

Quick 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

pgsc-new-coding-structureFig 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

Contributing