ph-locations
    TypeScript icon, indicating that this package has built-in type declarations

    1.1.3 • Public • Published

    ph-locations

    NPM version CI ISO 3166 PSGC License: MIT

    Library of locations in the Philippines

    Usage

    Install

    # NPM 
    npm install ph-locations
     
    # Yarn 
    yarn add ph-locations

    Import

    Default (ISO 3166)

    // CommonJS
    const {
      regions,
      provinces,
      citiesMunicipalities,
    } = require('ph-locations');
     
    // ES6
    import {
      regions,
      provinces,
      citiesMunicipalities,
    } from 'ph-locations';

    PSGC

    // CommonJS
    const {
      regions,
      provinces,
      citiesMunicipalities,
    } = require('ph-locations').psgc;
     
    // ES6
    import { psgc } from 'ph-locations';
    const {
      regions,
      provinces,
      citiesMunicipalities,
    } = psgc;
     

    ISO 3166 (same result as default)

    // CommonJS
    const {
      regions,
      provinces,
      citiesMunicipalities,
    } = require('ph-locations').iso3166;
     
    // ES6
    import { iso3166 } from 'ph-locations';
    const {
      regions,
      provinces,
      citiesMunicipalities,
    } = iso3166;

    Sources

    ISO 3166 & Wikipedia

    Philippine Standard Geographic Code (PSGC)

    Notes regarding NCR:

    PSGC does not assign NCR cities and municipalities under a province. Instead, they are classified under districts. Because of this, an unofficial pseudo-province called "Metro Manila" (code 130100000) was added and all cities and provinces of NCR are listed under this.

    Automatic Checking

    GitHub Actions (ISO 3166, PSGC) automatically run everyday to check if the data is updated. See the ISO 3166 and PSGC badges above.

    Properties

    Regions

    Property Description ISO 3166 PSGC
    code ISO 3166 or PSGC code
    name English name
    nameTL Tagalog name
    altName Alternative name, often the roman number or acronym of the region

    Provinces

    Property Description ISO 3166 PSGC
    code ISO 3166 or PSGC code
    name English name
    altName Alternative name, often its former name
    nameTL Tagalog name
    region ISO 3166 or PSGC code of the province's region

    Cities and Municipalities

    Property Description ISO 3166 PSGC
    code PSGC code
    name Name
    fullName Complete name. For ISO 3166, all cities will have names end with "City". For PSGC, this will be the complete name as listed in the PSGC website.
    altName Alternative name, often its former name
    province ISO 3166 or PSGC code of the city's or municipality's province
    classification Classification of the city or municipality (see below)
    isCapital Is the city or municipality the capital of the province

    Classification

    ISO 3166

    Value Description
    Mun Municipality
    CC Component city
    ICC Independent component city
    HUC Highly urbanized city

    PSGC

    Value Description
    MUNICIPALITY Municipality
    CITY City

    License

    Licensed under MIT License

    Install

    npm i ph-locations

    DownloadsWeekly Downloads

    17

    Version

    1.1.3

    License

    MIT

    Unpacked Size

    621 kB

    Total Files

    12

    Last publish

    Collaborators

    • hyubs