https://github.com/arnellebalane/zipcodes-ph
Philippines zip codes directory
https://github.com/arnellebalane/zipcodes-ph
hacktoberfest npm-package zipcode
Last synced: 3 months ago
JSON representation
Philippines zip codes directory
- Host: GitHub
- URL: https://github.com/arnellebalane/zipcodes-ph
- Owner: arnellebalane
- License: mit
- Created: 2017-10-30T12:23:09.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2021-09-07T10:51:42.000Z (over 3 years ago)
- Last Synced: 2025-02-17T16:05:52.195Z (3 months ago)
- Topics: hacktoberfest, npm-package, zipcode
- Language: JavaScript
- Homepage:
- Size: 137 KB
- Stars: 11
- Watchers: 4
- Forks: 5
- Open Issues: 1
-
Metadata Files:
- Readme: readme.md
- License: license
Awesome Lists containing this project
README
# zipcodes-ph
[]([](https://github.com/arnellebalane/zipcodes-ph))
[](https://github.com/arnellebalane/zipcodes-ph)
[](https://github.com/arnellebalane/zipcodes-ph)
[](https://github.com/arnellebalane/zipcodes-ph)
[](https://github.com/arnellebalane/zipcodes-ph)Philippines zip code directory.
## Installation
Install via npm:
```bash
$ npm install --save zipcodes-ph
```Browser builds are also available inside the `build` directory or in [unpkg.com](https://unpkg.com/[email protected]/build/index.umd.js).
## Usage
NodeJS:
```js
const zipcodes = require('zipcodes-ph');zipcodes.find(6000); // 'Cebu City'
zipcodes.reverse('Cebu City'); // 6000
```Browser:
```html
```
```js
// global variable `zipcodesPH` is exposedzipcodesPH.find(6000); // 'Cebu City'
zipcodesPH.reverse('Cebu City'); // 6000
```## API
- **`find(zipcode)`**
- `zipcode` _(Number|String)_: The zip code that will be resolved into a location name.
- possible return values:
- _String_ if one location with the zip code is found.
- _Array_ if multiple locaitons with the zip code are found.
- _null_ if no locations with the zip code are found.- **`reverse(location)`**
- `location` _(String)_: The name of the location that will be resolved into a zip code.
- possible return values:
- _Number_ if zip code for the location is found.
- _null_ if zip code for the location is not found.## License
MIT License