# react-hook-usecep

> a react hook to get address information

Latest version **1.0.6** (published 2021-05-31) · ISC license · 0 weekly downloads

## Install

```sh
npm install react-hook-usecep
pnpm add react-hook-usecep
yarn add react-hook-usecep
bun add react-hook-usecep
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.6 |
| Published | 2021-05-31 |
| First published | 2021-05-02 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 2.9 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 34 |
| Author | Dellean Santos |
| Maintainers | dellean.santos |
| Keywords | react, cep |

## Links

- npm: https://www.npmjs.com/package/react-hook-usecep
- Repository: https://github.com/tawsbob/react-hook-useCep
- Homepage: https://github.com/tawsbob/react-hook-useCep#readme
- Issues: https://github.com/tawsbob/react-hook-useCep/issues
- npm.io page: https://npm.io/package/react-hook-usecep

## Alternatives

- [mobx-react](https://npm.io/package/mobx-react.md) — 2.8M weekly downloads
- [rc-tree](https://npm.io/package/rc-tree.md) — 2.6M weekly downloads
- [@react-oauth/google](https://npm.io/package/@react-oauth/google.md) — 1.3M weekly downloads
- [@wagmi/connectors](https://npm.io/package/@wagmi/connectors.md) — 877.0K weekly downloads
- [vee-validate](https://npm.io/package/vee-validate.md) — 836.4K weekly downloads

## Recent versions

- 1.0.6 (latest) — 2021-05-31
- 1.0.5 — 2021-05-02
- 1.0.4 — 2021-05-02
- 1.0.3 — 2021-05-02
- 1.0.2 — 2021-05-02
- 1.0.1 — 2021-05-02
- 1.0.0 — 2021-05-02

## README

# useCep react hook

useCep is a react **hook** for get address information from [viacep](https://viacep.com.br/), 

## Installation

```bash
npm install react-hook-usecep -S
```

## Import

```javascript
import useCep from 'react-hook-usecep';
```

## Usage

```javascript
function MyReactComponent(){


	const [status, setCep] =  useCep()
	return (<input type="text" onBlur={(e)=>{ setCep(e.target.value) }} />)
}
```
### Status object 
```json
{
	"loading": false,
	"error": false,
	"data": {
		  "cep": "01001-000",
		  "logradouro": "Praça da Sé",
		  "complemento": "lado ímpar",
		  "bairro": "Sé",
		  "localidade": "São Paulo",
		  "uf": "SP",
		  "ibge": "3550308",
		  "gia": "1004",
		  "ddd": "11",
		  "siafi": "7107"
		}
}
```

---
_Source: https://npm.io/package/react-hook-usecep · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
