ecuador-postal-codes
v0.0.6
Published
Library with Ecuador postal codes
Downloads
186
Readme
ecuador-postal-codes
A Node.js module to fetch and query postal codes from Ecuador.
Installation
npm install ecuador-postal-codes --save
yarn add ecuador-postal-codes
Usage
var ecuador = require('ecuador-postal-codes');
Members
provinces
: Array of Province objectsprovincesArray
: Array of province nameslookupProvinces(<query>)
: Returns an array of Province objectslookupCities(<query>)
: Returns an array of City objectslookupTowns(<query>)
: Returns an array of Town objectslookupPostalCode(<query>)
: Returns a Town object that matches the postal code
Search provinces example
var results = ecuador.data.lookupProvinces('GUAYAS');
Province members
Each Province object contains:
name
: Name of the province in uppercasecities
: Array of City objects.citiesArray
: Array of city names.lookupCities(<query>)
: Returns an array of City objectslookupTowns(<query>)
: Returns an array of Town objects
Search cities examples
var results = ecuador.data.lookupCities('Quito');
Or you can searh within any province
var results = provinceObject.lookupCities('Quito');
City members
Each City object contains:
name
: Name of the city in uppercaseprovince
: Province object referencetowns
: Array of Town objectstownsArray
: Array of town nameslookupTowns(<query>)
: Returns an array of Town objects
Search towns (AKA parroquias) examples
var results = ecuador.data.lookupCities('Tarqui');
Or you can searh within any city
var results = cityObject.lookupCities('Quito');
Town members
Each Town object contains:
name
: Name of the city in uppercasepostalCode
: Postal code of the city as stringcity
: City object referencepostalCodeAsNumber()
: Postal code of the city as number
Contribute
Clone this repo, NPM-it and run the tests:
npm run test
Thanks
Special thanks to @emamut for the data.