npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@ianlabicani/geoph-lite

v2.0.0

Published

Lightweight 2Q 2026 Philippine Standard Geographic Code hierarchy.

Downloads

948

Readme

geoph-lite

Lightweight Philippine region, province, city/municipality, and barangay data from the Philippine Standard Geographic Code (PSGC), without map geometry.

Version 2 contains the PSGC hierarchy as of 30 June 2026. It preserves the official parentage of independent and highly urbanized cities, NCR localities, Pateros, and the region-level BARMM municipalities instead of assigning them to synthetic provinces.

Install

npm install @ianlabicani/geoph-lite

geoph-lite is an ESM package for Node.js 20.10 or newer and modern application tools such as Vite, Next.js, React, and Vue.

Address-form API

Every PSGC code is returned as a 10-character string. Use strings in application state so leading zeroes are preserved.

import { philippines } from '@ianlabicani/geoph-lite';

const regions = philippines.regions();
const provinces = await philippines.provinces(regionCode);

// A parent can be a region or a province.
const regionLocalities = await philippines.localities(regionCode);
const provinceLocalities = await philippines.localities(provinceCode);

const barangays = await philippines.barangays(localityCode);

List and search results are shallow summaries:

{
  psgc_code: '0402103000',
  name: 'City of Bacoor',
  type: 'city'
}

type is present only for localities and is either city or municipality.

API reference

| Export or method | Returns | | --- | --- | | regions / philippines.regions() | Immediate summaries for all 18 regions. | | loadRegion(region) / philippines.region(region) | The complete native hierarchy for one region. | | provinces(region) / philippines.provinces(region) | Province summaries for a region. | | localities(parentCode) / philippines.localities(parentCode) | City/municipality summaries directly under a region or province. | | barangays(localityCode) / philippines.barangays(localityCode) | Barangay summaries for a locality. | | findRegions(query) | Case-insensitive region name or code matches. | | findProvinces(region, query) | Case-insensitive province matches within a region. | | findLocalities(parentCode, query) | Case-insensitive locality matches under a region or province. |

Region loaders accept an exact region name or PSGC code. Parent and locality lookups use globally unique PSGC codes. Numeric codes are accepted and left-padded to 10 digits, but strings are preferred.

Unknown codes and incorrect parent types throw descriptive errors rather than returning data from the wrong level.

Full hierarchy and direct JSON imports

import { loadRegion } from '@ianlabicani/geoph-lite';

const ncr = await loadRegion('1300000000');
console.log(ncr.localities);

The returned value uses the native data shape:

{
  psgc_code: '1300000000',
  name: 'National Capital Region (NCR)',
  provinces: [],
  localities: [/* cities and municipalities with barangays */]
}

Known generated region files can also be imported directly:

import ncr from '@ianlabicani/geoph-lite/regions/1300000000-national-capital-region-ncr.json' with { type: 'json' };

The complete dataset is split by region and loaded lazily. Importing the package loads only the small region catalog and parent index; the full hierarchy for a region loads when it is requested.

Working example

The repository includes a plain HTML address form that handles both Region → Locality → Barangay and Region → Province → Locality → Barangay:

npm run example

Open http://localhost:4173. Browsers block module imports when the example is opened directly with file://.

Data source and licensing

The administrative data is a Second Quarter 2026 snapshot of the Philippine Statistics Authority Philippine Standard Geographic Code, as of 30 June 2026.

Package code is distributed under the MIT License. The PSGC data has separate attribution and licensing information in DATA_LICENSE.md.

This package contains administrative lookup data only. It has no geometry or coordinates and is not suitable for maps, routing, reverse geocoding, or spatial analysis.