swiss-zipcodes
Purpose
Search and validate swiss zip codes
Usage
npm i --save swiss-zipcodes# or npm install https://github.com/creadi/swiss-zipcodes
and
search()
Search by any combination of:
zip
(number
)canton
(string
)commune
(string
)
returns
zip: 4054 canton: 'BS' commune: 'Basel'
validate()
Validate zip
code as number
or string
// or
returns true
cityFromZip()
Get an array of commune
names from a zip code ( number
or string
)
// or
returns
'Basel' 'Münchenstein'
allZips
is an array of zipcodes (number
)
Data
Data from Federal Statistics.
Direct link to excel sheet.
Update 1.0.6
Add data from geonames extraction