Skip to content

isaacdarcilla/select-philippines-address

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Promised-based select addresses in the Philippines using HTML select tag base on address codes or location name.

js-standard-style npm version codecov

Demos

React JS

Deploy with Vercel

Vue JS

Deploy with Vercel

Installation

npm i select-philippines-address --save

Usage

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));

Description

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.

Demo Source Code

License

Apache-2.0

Contributors