npm.io
1.0.4 • Published 6 years ago

get-state-iso2

Licence
MIT
Version
1.0.4
Deps
2
Size
16.1 MB
Vulns
1
Weekly
0

Base Zipcode ISO3166-2

ZipUtil to get the state in ISO3166-2 format based on Country & Zip code.

Install

npm i get-state-iso2 --save

Usage

Import

const ZipUtil = require('get-state-iso2').default

Initialize ZipUtil by passing configuration object in load function

ZipUtil.init({supportedCountries: ['IN'], supportedCountryOnly: true});

To get the state

await ZipUtil.getInstance().getState('NL', '1016 DC');
await ZipUtil.getInstance().getState('IN', '110016');
License

MIT

Keywords