Promised-based select addresses in the Philippines using HTML select tag base on address codes or location name.
React JS
Vue JS
npm i select-philippines-address --save
import { regions, provinces, cities, barangays, regionByCode, provincesByCode, provinceByName } from "select-philippines-address";
regions().then((region) => console.log(region));
regionByCode("01").then((region) => console.log(region.region_name));
provinces("01").then((province) => console.log(province));
provincesByCode("01").then((province) => console.log(province));
provinceByName("Rizal").then((province) => console.log(province.province_code));
cities("0128").then((city) => console.log(city));
barangays("052011").then((barangays) => console.log(barangays));
Function | Parameters | Description |
---|---|---|
regions() |
None | Returns all regions. |
regionByCode() |
region_code |
Returns a region by its code. |
provinces() |
region_code |
Returns provinces in the specified region. |
provincesByCode() |
region_code |
Returns provinces in the specified region. |
provinceByName() |
province_name |
Returns a province by its name. |
cities() |
province_code |
Returns cities in the specified province. |
barangays() |
city_code |
Returns barangays in the specified city. |