Socket
Book a DemoInstallSign in
Socket

ph-geo-admin-divisions

Package Overview
Dependencies
Maintainers
1
Versions
9
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ph-geo-admin-divisions

focuses on the geographic and administrative divisions of the Philippines up to barranggay level

1.0.8
latest
Source
npmnpm
Version published
Weekly downloads
33
-69.72%
Maintainers
1
Weekly downloads
 
Created
Source


ph-geo-admin-divisions

focuses on the geographic and administrative divisions of the Philippines up to barranggay level
Explore the docs »

Getting Started

A library that enables search using an updated collection of Philippines Geo Administrative divisions.

Data Models

Region

{
  "psgcId": "0100000000",
  "name": "Region I (Ilocos Region)",
  "geoLevel": "Reg",
  "regionId": "01",
  "provinceId": "000",
  "municipalityId": "00",
  "baranggayId": "000"
}

Province

{
  "psgcId": "0102800000",
  "name": "Ilocos Norte",
  "geoLevel": "Prov",
  "regionId": "01",
  "provinceId": "028",
  "municipalityId": "00",
  "baranggayId": "000"
}

Municipality

{
  "psgcId": "0102801000",
  "name": "Adams",
  "geoLevel": "Mun",
  "regionId": "01",
  "provinceId": "028",
  "municipalityId": "01",
  "baranggayId": "000"
}

Baranggay

{
  "psgcId": "0102801001",
  "name": "Adams (Pob.)",
  "geoLevel": "Bgy",
  "regionId": "01",
  "provinceId": "028",
  "municipalityId": "01",
  "baranggayId": "001"
}

Usage

Listing Records

const allRegions = await searchRegion();
const allProvinces = await searchProvince();
const allMunicipalities = await searchMunicipalities();
const allBaranggays = await searchBaranggays();

Listing Parameters

interface SearchParams {
  name?: string;
  regionId?: string;
  provinceId?: string;
  municipalityId?: string;
  baranggayId?: string;
}

check test.spec.ts for more usage.

Special Handling for NCR

National Capital Region is manually added to the province list, catering for this special need to complete the flow of searching province, municipality then baranggay, this eliminates the process of searching Regions etc.

License

Distributed under the MIT License. See LICENSE for more information.

Contact

Mark Ernest R. Matute- linkedin - markernest.matute@gmail.com

(back to top)

Keywords

philippines geographic

FAQs

Package last updated on 03 Jan 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.