getPostOffice
function getPostOffice(code): PostOffice | null;Defined in: post-offices.ts:48
Returns the delivery post office for a post code, from Pakistan Post’s directory of about 2,560 offices.
Unlike getCityByPostalCode, which only answers for codes in the cities
pakdatakit lists, this knows every delivery office, including those in
towns and villages.
Parameters
Section titled “Parameters”| Parameter | Type | Description |
|---|---|---|
code |
string |
Post code (whitespace is ignored) |
Returns
Section titled “Returns”PostOffice | null
The post office, or null if the code is not in the directory
Example
Section titled “Example”getPostOffice('48330');// { code: '48330', office: 'Dulmial', town: 'Dulmial', district: null, province: 'Punjab' }