This package has been deprecated

Author message:

Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.

@dctsph/psgc

1.1.0 • Public • Published

About

A collection of Philippine Standard Geographic Code that were broken down by:

  • Barangays
  • Cities / Municipalities
  • Provinces
  • Regions

PSGC Publication Date

Collection Samples

Barangay

{ "name": "Bayanan", "bgy_code": "042103004", "mun_code": "042103000" }

City/Municipality

{ "name": "City of Bacoor", "mun_code": "042103000", "prv_code": "042100000" }

Province

{ "name": "Cavite", "prv_code": "042100000", "reg_code": "040000000" }

Region

{ "name": "Region IV-A (CALABARZON)", "reg_code": "040000000" }

Installation

$ npm install @dctsph/psgc

Usage

Import the package in your application.

import psgc from "@dctsph/psgc";

Available Methods

Method Description Example
getAllRegions() Show all regions. psgc.getAllRegions()
getAllProvinces() Show all provinces.

Usage:
Use this if you want to start the filter by province instead of region and use the getRegionByProvince method to get the selected province's region.
psgc.getAllProvinces()
getBarangaysByMunicipality(mun_code) Get all barangays by municipality. psgc.getBarangaysByMunicipality('042103000')
getMunicipalitiesByProvince(prv_code) Get all municipalities by province. psgc.getMunicipalitiesByProvince('042100000')
getProvincesByRegion(reg_code) Get all provinces by region. psgc.getProvincesByRegion('040000000')
getBarangaysByProvince(prv_code) Get all barangays by province. psgc.getBarangaysByProvince('042100000')
getRegionByProvince(prv_code) Get region by province. psgc.getRegionByProvince('042100000')

⚠️ Note:

  • Getting the list of all barangays will not be added to avoid any performance issues due to its large number of items.

References

License

Licensed under MIT

Package Sidebar

Install

npm i @dctsph/psgc

Weekly Downloads

1

Version

1.1.0

License

MIT

Unpacked Size

3.23 MB

Total Files

8

Last publish

Collaborators

  • fbandres17