You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 4-6.RSVP
Socket
Book a DemoInstallSign in
Socket

addrtozip

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

addrtozip

API for finding zipcode by address in Taiwan

1.0.2
Source
npmnpm
Version published
Maintainers
1
Created
Source

API for finding zipcode in Taiwan NPM version Build Status

NPM

This package is reference from mosky .

Installation

$ npm install addrtozip

Usage

####First you have to require the package.

var addrtozip = require('addrtozip');

Send an address to query zipcode.

addr: Required. An address for finding zipcode

callback: Required. Callback will return a json contain zipcode and address.

addrtozip.find(addr, callback);

Example

var addrtozip = require('addrtozip');
addrtozip.find('台北市信義區市府路45號', function (zipcode){
  console.log(zipcode);
}

And you will get a json data, like this.

{ zipcode: '11001', addr: '台北市信義區市府路45號' }

Gradual

A legal address contain city(縣市), area(鄉鎮市區), street(路街巷弄號), and exclude village(村里) and neighborhood(鄰). We also can find informal zipcode gradually, but that will reduce the precision.

var addrtozip = require('addrtozip');
addrtozip.find('台北市', function (zipcode){
  // { zipcode: '1', addr: '台北市' }
}
addrtozip.find('台北市信義區', function (zipcode){
  // { zipcode: '110', addr: '台北市信義區' }
}
addrtozip.find('台北市信義區市府路', function (zipcode){
  // { zipcode: '110', addr: '台北市信義區市府路' }
}
addrtozip.find('台北市信義區市府路45號', function (zipcode){
  // { zipcode: '11001', addr: '台北市信義區市府路45號' }
}

If any adress is legal, but return wrong zipcode. Please let me know. Thanks.

Keywords

zipcode

FAQs

Package last updated on 23 May 2014

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts