@efdiaz/psgc
TypeScript icon, indicating that this package has built-in type declarations

1.0.3 • Public • Published

Philippine Standard Geographic Code (PSGC)

Provides PSGC (Philippine Standard Geographic Code) data for your applications and API's.

Installation

npm install --save @efdiaz/psgc

Usage

Method Param Type Description Example
getRegions Get all the regions
getProvinces regCode string Get all province by region code "04"
getCityMuns provCode string Get all cities/municipalities by province code "0434"
getBarangays citymunCode string Get all barangays by city/municipality '043424'

Sample

import {
  IRegion,
  getRegions,
  IProvince,
  getProvinces,
  ICityMun,
  getCityMuns,
  IBarangay,
  getBarangays,
} from '@efdiaz/psgc';

// Get all regions
const regions: IRegion[] = getRegions();

// Get all the province of the selected region
const REGIN_IV_PROVINCES: IProvince[] = getProvinces('04');

// Get all the cities/municipalities of the selected province
const LAGUNA_MUNICIPALITIES_CITIES: ICityMun[] = getCityMuns('0434');

// Get all the barangays of the selected city/municipality
const SAN_PABLO_CITY_BARANGAYS: IBarangay[] = getBarangays('043424');

Building

To build the library.

npx nx build psgc

Running unit tests

To execute the unit tests via Jest.

nx test psgc

Maintainers

Credits

Contributing

  1. Fork it!
  2. Create your feature branch: git checkout -b my-new-feature
  3. Commit your changes: git commit -am 'Add some feature'
  4. Push to the branch: git push origin my-new-feature
  5. Submit a pull request

Package Sidebar

Install

npm i @efdiaz/psgc

Weekly Downloads

3

Version

1.0.3

License

none

Unpacked Size

8.17 MB

Total Files

36

Last publish

Collaborators

  • dev.edmardiaz