{"id":16497549,"url":"https://github.com/raisiqueira/use-viacep","last_synced_at":"2025-03-21T08:30:46.729Z","repository":{"id":36973017,"uuid":"255392271","full_name":"raisiqueira/use-viacep","owner":"raisiqueira","description":"React hook to fetch Brazilian Zip Code using ViaCEP api.","archived":false,"fork":false,"pushed_at":"2023-07-07T23:56:52.000Z","size":516,"stargazers_count":12,"open_issues_count":10,"forks_count":2,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-17T22:44:45.071Z","etag":null,"topics":["brazilian-utils","cep","react-hooks","typescript","viacep"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/@rsiqueira/use-viacep","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/raisiqueira.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null},"funding":{"github":"raisiqueira","ko_fi":"raisiqueira"}},"created_at":"2020-04-13T17:11:31.000Z","updated_at":"2023-03-29T20:33:57.000Z","dependencies_parsed_at":"2023-02-17T02:10:22.177Z","dependency_job_id":null,"html_url":"https://github.com/raisiqueira/use-viacep","commit_stats":null,"previous_names":[],"tags_count":18,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/raisiqueira%2Fuse-viacep","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/raisiqueira%2Fuse-viacep/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/raisiqueira%2Fuse-viacep/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/raisiqueira%2Fuse-viacep/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/raisiqueira","download_url":"https://codeload.github.com/raisiqueira/use-viacep/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244764629,"owners_count":20506669,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["brazilian-utils","cep","react-hooks","typescript","viacep"],"created_at":"2024-10-11T14:44:41.244Z","updated_at":"2025-03-21T08:30:45.970Z","avatar_url":"https://github.com/raisiqueira.png","language":"TypeScript","funding_links":["https://github.com/sponsors/raisiqueira","https://ko-fi.com/raisiqueira"],"categories":[],"sub_categories":[],"readme":"# useViaCep\n\n\u003cp align=\"center\"\u003e\n \u003cimg width=\"60%\" height=\"60%\" src=\"https://res.cloudinary.com/dwc5hkby0/image/upload/v1586797570/project-logo.svg\"\u003e\n\u003c/p\u003e\n\n![use-viacep](https://badgen.net/bundlephobia/minzip/@rsiqueira/use-viacep)\n\nReact hook to fetch Brazilian CEP's using ViaCEP api.\n\n## Install\n\n```bash\nnpm i --save @rsiqueira/use-viacep # or yarn add @rsiqueira/use-viacep\n```\n\n## Usage\n\n```tsx\nimport * as React from 'react';\nimport * as ReactDOM from 'react-dom';\nimport useViaCep from '@rsiqueira/use-viacep';\n\nconst App = () =\u003e {\n  const [data, setData] = React.useState('');\n  const { cep, loading, error } = useViaCep(data);\n\n  if (loading) {\n    return \u003cp\u003eloading...\u003c/p\u003e;\n  }\n\n  return (\n    \u003cdiv\u003e\n      \u003cinput placeholder=\"cep\" onChange={(e) =\u003e setData(e.target.value)} /\u003e\n    \u003c/div\u003e\n  );\n};\n\nReactDOM.render(\u003cApp /\u003e, document.getElementById('root'));\n```\n\n## Contributing\n\nClone this repository and run `pnpm install`. If you don't have pnpm, install it with `npm install -g pnpm`.\n\n### Folder structure\n\n- `example` - A folder with an example project. Think as playground.\n- `lib` - The source of `@rsiqueira/use-viacep`.\n\n### What is in this repository?\n\n- [PNPM](https://pnpm.io/workspaces) as workspace manager and package manager.\n- [TSUP](https://tsup.egoist.dev/) as a TypeScript universal package.\n- [Vitest](https://vitest.dev/) as a test runner.\n- [Size Limit](https://github.com/ai/size-limit) as a size limit plugin.\n- [Prettier](https://prettier.io/) as a code formatter.\n- [ESLint](https://eslint.org/) as a code linter.\n\n### Using the Playground\n\nIn the root of the repository, run the following command:\n\n```bash\npnpm run dev # to build the library (with --watch flag)\npnpm -F example dev\n```\n\nThe command will run the example project with [Vite](https://vitejs.dev/).\n\n## Sponsors\n\n[![Sponsors](https://cdn.jsdelivr.net/gh/raisiqueira/static@master/sponsors.svg)](https://github.com/sponsors/raisiqueira)\n\n## License\n\nMIT @ Rai Siqueira\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fraisiqueira%2Fuse-viacep","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fraisiqueira%2Fuse-viacep","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fraisiqueira%2Fuse-viacep/lists"}