3.1.0 โข Published 6 years ago
@jariz/i18n-zipcodes v3.1.0
i18n-zipcodes
International zipcodes validator in Javascript, based on Regex for Node.js and the browser.
Install
For Node.js:
$ npm install i18n-zipcodesFor the browser:
- Download the script in the
distfolder
Usage
i18nZipcodes(countryCode: string, zipCode: string): boolean
// countryCode param is case insensitiveFor Node.js
// CommonJS Syntax
const i18nZipcodes = require('i18n-zipcodes');
// or ES Syntax
import i18nZipcodes from 'i18n-zipcodes';
i18nZipcodes('US', '90210'); // true
i18nZipcodes('fr', '5632'); // falseFor the browser
<script src="i18n-zipcodes.min.js"></script>
<script>
console.log(i18nZipcodes('fr', '75014')); // true
</script>115 Countries supported
Country codes use the ISO 3166-1 format.
A
- ๐ฆ๐ฉ (
AD) Andorra - ๐ฆ๐ฒ (
AM) Armenia - ๐ฆ๐ท (
AR) Argentina - ๐ฆ๐ธ (
AS) American Samoa - ๐ฆ๐น (
AT) Austria - ๐ฆ๐บ (
AU) Australia - ๐ฆ๐ฟ (
AZ) Azerbaijan
B
- ๐ง๐ฆ (
BA) Bosnia and Herzegovina - ๐ง๐ฉ (
BD) Bangladesh - ๐ง๐ช (
BE) Belgium - ๐ง๐ฌ (
BG) Bulgaria - ๐ง๐ฏ (
BJ) Benin - ๐ง๐ฒ (
BM) Bermuda - ๐ง๐ณ (
BN) Brunei - ๐ง๐ท (
BR) Brazil - ๐ง๐พ (
BY) Belarus
C
- ๐จ๐ฆ (
CA) Canada - ๐จ๐ญ (
CH) Switzerland - ๐จ๐ณ (
CN) China - ๐จ๐บ (
CU) Cuba - ๐จ๐ฝ (
CX) Christmas Island - ๐จ๐พ (
CY) Cyprus - ๐จ๐ฟ (
CZ) Czechia
D
- ๐ฉ๐ช (
DE) Germany - ๐ฉ๐ฐ (
DK) Denmark - ๐ฉ๐ฟ (
DZ) Algeria
E
- ๐ช๐ช (
EE) Estonia - ๐ช๐ธ (
ES) Spain
F
- ๐ซ๐ฎ (
FI) Finland - ๐ซ๐ฒ (
FM) Micronesia - ๐ซ๐ด (
FO) Faroe Islands - ๐ซ๐ท (
FR) France
G
- ๐ฌ๐ช (
GE) Georgia - ๐ฌ๐ซ (
GF) French Guiana - ๐ฌ๐ฑ (
GL) Greenland - ๐ฌ๐ต (
GP) Guadeloupe - ๐ฌ๐ท (
GR) Greece - ๐ฌ๐น (
GT) Guatemala - ๐ฌ๐บ (
GU) Guam - ๐ฌ๐ผ (
GW) Guinea-Bissau
H
- ๐ญ๐ท (
HR) Croatia - ๐ญ๐บ (
HU) Hungary
I
- ๐ฎ๐จ (
IC) Canary Islands - ๐ฎ๐ฉ (
ID) Indonesia - ๐ฎ๐ช (
IE) Ireland - ๐ฎ๐ฑ (
IL) Israel - ๐ฎ๐ณ (
IN) Inde - ๐ฎ๐ธ (
IS) Iceland - ๐ฎ๐น (
IT) Italy
J
- ๐ฏ๐ต (
JP) Japan
K
- ๐ฐ๐ช (
KE) Kenya - ๐ฐ๐ฌ (
KG) Kyrgyzstan - ๐ฐ๐ท (
KR) South Korea - ๐ฐ๐ผ (
KW) Kuwait - ๐ฐ๐ฟ (
KZ) Kazakhstan
L
- ๐ฑ๐ฎ (
LI) Liechtenstein - ๐ฑ๐น (
LT) Lithuania - ๐ฑ๐บ (
LU) Luxembourg - ๐ฑ๐ป (
LV) Latvia
M
- ๐ฒ๐ฆ (
MA) Morocco - ๐ฒ๐ฉ (
MD) Moldova - ๐ฒ๐ช (
ME) Montenegro - ๐ฒ๐ฌ (
MG) Madagascar - ๐ฒ๐ญ (
MH) Marshall Islands - ๐ฒ๐ฐ (
MK) North Macedonia - ๐ฒ๐ฒ (
MM) Myanmar - ๐ฒ๐ณ (
MN) Mongolia - ๐ฒ๐ต (
MP) Northern Mariana Islands - ๐ฒ๐ถ (
MQ) Martinique - ๐ฒ๐น (
MT) Malta - ๐ฒ๐ป (
MV) Maldives - ๐ฒ๐ฝ (
MX) Mexico - ๐ฒ๐พ (
MY) Malaysia - ๐ฒ๐ฟ (
MZ) Mozambique
N
- ๐ณ๐ฑ (
NL) Netherlands - ๐ณ๐ด (
NO) Norway - ๐ณ๐ฟ (
NZ) New Zealand
P
- ๐ต๐ญ (
PH) Philippines - ๐ต๐ฐ (
PK) Pakistan - ๐ต๐ฑ (
PL) Poland - ๐ซ๐ท (
PM) Saint Pierre and Miquelon - ๐ต๐ท (
PR) Puerto Rico - ๐ต๐ธ (
PS) Palestine - ๐ต๐น (
PT) Portugal - ๐ต๐ผ (
PW) Palau
R
- ๐ท๐ช (
RE) Rรฉunion - ๐ท๐ด (
RO) Romania - ๐ท๐ธ (
RS) Serbia - ๐ท๐บ (
RU) Russian Federation
S
- ๐ธ๐ฆ (
SA) Saudi Arabia - ๐ธ๐ฉ (
SD) Sudan - ๐ธ๐ช (
SE) Sweden - ๐ธ๐ฌ (
SG) Singapore - ๐ธ๐ฎ (
SI) Slovenia - ๐ธ๐ฐ (
SK) Slovakia - ๐ธ๐ฒ (
SM) San Marino - ๐ธ๐ฟ (
SZ) Swaziland
T
- ๐น๐ญ (
TH) Thailand - ๐น๐ฏ (
TJ) Tajikistan - ๐น๐ฒ (
TM) Turkmenistan - ๐น๐ณ (
TN) Tunisia - ๐น๐ท (
TR) Turkey - ๐น๐ผ (
TW) Taiwan
U
- ๐บ๐ฆ (
UA) Ukraine - ๐ฌ๐ง (
UK) United Kingdom - ๐บ๐ธ (
US) United States of America - ๐บ๐พ (
UY) Uruguay - ๐บ๐ฟ (
UZ) Uzbekistan
V
- ๐ป๐ช (
VE) Venezuela - ๐ป๐ฎ (
VI) Virgin Islands (U.S.) - ๐ป๐ณ (
VN) Viet Nam
X
- ๐ฝ๐ฐ (
XK) Kosovo
Y
- (
YU) Yugoslavia
Z
- ๐ฟ๐ฆ (
ZA) South Africa - ๐ฟ๐ฒ (
ZM) Zambia
3.1.0
6 years ago