JSPM

node-postalcodes

0.1.1
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • 0
  • Score
    100M100P100Q14899F
  • License MIT

Node server for postal code lookup and search

Package Exports

  • node-postalcodes

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 (node-postalcodes) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

node-postalcodes

Node server for postal code lookup and search

A simple web server around geonames-postalcodes.

This project does not include any postal code data files. See geonames-postalcodes for more information on the data files. Geonames requires credit if you use their data.

Install

npm install

Configure

Edit config/config.json with the path to your postal codes datafile. See geonames-postalcodes for more information about this file.

Start

npm start

Usage

Postal code lookup

http://localhost:10011/api/postalCodeLookup?postalCode=K2K

{
  "countryCode": "CA",
  "postalCode": "K2K",
  "placeName": "Kanata (Beaverbrook / South March)",
  "adminName1": "Ontario",
  "adminCode1": "ON",
  "adminName2": "Kanata",
  "adminCode2": "",
  "adminName3": "",
  "adminCode3": "",
  "latitude": "45.3704",
  "longitude": "-75.9198",
  "accuracy": "1"
}

http://localhost:10011/api/postalCodeSearch?postalCode=K2

http://localhost:10011/api/placeNameSearch?placeName=stit