1.0.9 • Published 10 months ago

ph-zipcode-lookup v1.0.9

Weekly downloads
-
License
MIT
Repository
github
Last release
10 months ago

ph-zipcode-lookup

npm downloads license

A simple package to get the zipcodes of the Philippines.

Installation

You can install this package using npm:

npm install ph-zipcode-lookup

API

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

1.0.9

10 months ago

1.0.8

10 months ago

1.0.7

10 months ago

1.0.6

10 months ago

1.0.5

10 months ago

1.0.4

10 months ago

1.0.3

10 months ago

1.0.2

10 months ago

1.0.1

10 months ago

1.0.0

10 months ago