Package Exports
- ph-zipcode-lookup
- ph-zipcode-lookup/dist/index.js
- ph-zipcode-lookup/dist/index.mjs
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (ph-zipcode-lookup) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
ph-zipcode-lookup
A simple package to get the zipcodes of the Philippines.
Installation
You can install this package using npm:
npm install ph-zipcode-lookupAPI
findLocation(zipcode)
zipcode(string): The zipcode to find the location for.- Returns: The location corresponding to the given zipcode, or null if not found.
findZipcode(location)
location(string): The location to find the zipcode for.- Returns: The zipcode corresponding to the given location, or null if not found.
Usage
In a React app
import React from "react";
import zipcodes from "ph-zipcode-lookup";
function App() {
const location = zipcodes.findLocation("1000");
const zipcode = zipcodes.findZipcode("Manila");
return (
<div>
<p>Location for zipcode 1000: {location}</p>
<p>Zipcode for Manila: {zipcode}</p>
</div>
);
}
export default App;In a Node.js app
const zipcodes = require("ph-zipcode-lookup");
const location = zipcodes.findLocation("1000");
const zipcode = zipcodes.findZipcode("Manila");
console.log(`Location for zipcode 1000: ${location}`);
console.log(`Zipcode for Manila: ${zipcode}`);Acknowledgements
This package was inspired by the zipcodes-ph npm package. Many thanks to the original developer for their work.
License
This project is licensed under the MIT License - see the LICENSE file for details.
Author
Mark Leigh David