A JavaScript library to interface with postal code API
A JavaScript library to interface with Postal Code API.
This library covers all your needs for integrating with Postal Code API, providing:
- A clean Promise-based interface
- Postal code validations (type and length)
``bash`
yarn add @bcredi/postalcode --save
Import like usual:
`js
import postalcode from '@bcredi/postalcode';
postalcode('81050200').then(console.log);
// "data": {
// "abbreviation": "R Pedro Gusso",
// "city": "Curitiba",
// "complement": "- até 1384/1385",
// "name": "Pedro Gusso",
// "neighborhood": "Novo Mundo",
// "postal_code": 81050200,
// "state": "PR",
// "type": "Rua"
// }
`
You can also use the latest release from our CDN and import the build
directly in your HTML:
`html`
The library will be available as the global variable postalcode.
To build the library, use npm dev.
To run the library tests, use npm test.
We use SemVer for versioning. For the versions available, see the tags on this repository.
```
The MIT License (MIT)
Copyright (c) 2019 Bcredi Serviços de Crédito e Cobrança S.A.