# philippine-location-json-for-geer

> A Javascript library to get the regions, provinces, cities, municipalities and barangays in the Philippines

Latest version **1.1.11** (published 2021-03-18) · ISC license · 0 weekly downloads

## Install

```sh
npm install philippine-location-json-for-geer
pnpm add philippine-location-json-for-geer
yarn add philippine-location-json-for-geer
bun add philippine-location-json-for-geer
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; large bundle.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.1.11 |
| Published | 2021-03-18 |
| First published | 2021-03-11 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 11.2 MB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Ernest Jay Cubillas |
| Maintainers | ijolomangaya1999 |
| Keywords | Philippines, Philippines Provinces, Philippines Regions, Philippines Cities, Philippines Municipalities, Philippines Barangays, npm, npm-philippines, Javascript, node, js |

## Links

- npm: https://www.npmjs.com/package/philippine-location-json-for-geer
- Repository: https://github.com/johny9647/philippine-location-json
- Homepage: https://github.com/ejcubillas/philippines-reg-prov-mun-brgy#readme
- Issues: https://github.com/ejcubillas/philippines-reg-prov-mun-brgy/issues
- npm.io page: https://npm.io/package/philippine-location-json-for-geer

## Alternatives

- [@mapbox/jsonlint-lines-primitives](https://npm.io/package/@mapbox/jsonlint-lines-primitives.md) — 5.3M weekly downloads
- [reftools](https://npm.io/package/reftools.md) — 3.5M weekly downloads
- [@hey-api/openapi-ts](https://npm.io/package/@hey-api/openapi-ts.md) — 3.5M weekly downloads
- [@mapbox/geojson-rewind](https://npm.io/package/@mapbox/geojson-rewind.md) — 2.4M weekly downloads
- [turbo-stream](https://npm.io/package/turbo-stream.md) — 1.7M weekly downloads

## Recent versions

- 1.1.11 (latest) — 2021-03-18
- 1.1.10 — 2021-03-18
- 1.1.9 — 2021-03-18
- 1.1.8 — 2021-03-17
- 1.1.7 — 2021-03-17
- 1.1.6 — 2021-03-16
- 1.1.5 — 2021-03-11
- 1.1.4 — 2021-03-11
- 1.1.3 — 2021-03-11
- 1.1.2 — 2021-03-11

## README

### Description
A Javascript library to get the regions, provinces, cities, municipalities and barangays in the Philippines

------------

### Installation


**Via NPM**

`npm i phil-reg-prov-mun-brgy`

or

****Via `<script>` Tag****
- Download the phil.min.js from the build folder
- Include to HTML file `<script type="text/javascript" src="path_to/phil.min.js">`
------------
### Usage

#### Via NPM
`var phil = require('phil-reg-prov-mun-brgy')`

or

`import phil from 'phil-reg-prov-mun-brgy'`

You can also import properties and methods

  `import { regions, getProvincesByRegion, ... } from 'phil-reg-prov-mun-brgy'`
   ```javascript
var phil = require('phil-reg-prov-mun-brgy');
console.log(phil.regions);
```
or

```javascript
import phil from 'phil-reg-prov-mun-brgy';
console.log(phil.barangays);
```


 #### Via Script Tag
  `<script type="text/javascript" src="path_to/phil.min.js">`

  You can now access the '*Philippines*' object globally
  `window.Philippines` or `Philippines`
 ```javascript
<script type="text/javascript" src="path_to/phil.min.js">
<script type="text/javascript">
      Philippines.getProvincesByRegion('01');
	  console.log(Philippines.provinces);
</script>
```

------------

### Properties and methods
| Property  | Type  |  Description |
| ------------ | ------------ | ------------ |
| regions  | Array  | List of all regions  |
| provinces  | Array  | List of all provinces  |
| city_mun  |  Array | List of all cities and municipalities  |
| barangays  |  Array | List of all barangays  |
| getProvincesByRegion  |  Function | Provinces in the selected region. *Parameter (region_code)* |
| getCityMunByProvince  |  Function |  Cities and Municipalities in the selected Province. *Parameter (province_code)* |
| getBarangayByMun  |  Function |  Barangays in the selected City. *Parameter (mun_code)* |
| sort  |  Function |  Sorts the array. *Parameters (arr, sort = 'A' or 'Z')* |


------------

## Credits
[National Statistical Coordination Board](http://www.nscb.gov.ph/ "National Statistical Coordination Board")
[clavearnel](https://github.com/clavearnel/philippines-region-province-citymun-brgy "clavearnel")

---
_Source: https://npm.io/package/philippine-location-json-for-geer · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
