npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

brasil-ceps-offline

v2.5.9

Published

Motor de Inteligência Geográfica Offline para CEPs brasileiros — dados do Censo IBGE 2022 com IBGE, DDD, fuso horário e coordenadas

Readme

🗺️ Brasil CEPs Offline

Inteligência geográfica e busca de CEPs 100% offline e ultrarrápida.

Playground

Esqueça limites de requisição (Rate Limits) ou latência de rede. Esta biblioteca traz um banco de dados local, entregando endereços, coordenadas e dados fiscais em milissegundos.

✨ Diferenciais

  • Performance Extrema: Consultas locais em SQLite (~1ms).
  • 📍 Busca Semântica: Encontre CEPs por pedaços do nome da rua ou logradouro.
  • 📦 Sync Inteligente: O banco de ~175MB é baixado automaticamente de nossa infraestrutura dedicada.

📥 Instalação e Ativação

npm install brasil-ceps-offline

# Baixa o banco de dados mais recente
npx brasil-ceps-offline sync

Recomendação: Adicione o sync no postinstall do seu package.json para garantir que o servidor sempre inicie com o banco atualizado.


💻 Como Usar

1. Busca Direta por CEP

import { findByCep } from 'brasil-ceps-offline';

const endereco = findByCep('01001-000');
// Retorna objeto Address completo ou null

2. Busca por Nome de Rua (Logradouro)

Ideal para autocompletar endereços ou encontrar CEPs sem o número em mãos.

import { findByAddress } from 'brasil-ceps-offline';

const resultados = findByAddress({
  street: 'Paulista',
  state: 'SP',  // Opcional — restringe ao estado
  limit: 5,     // Opcional — padrão: 10
});

📦 Estrutura de Resposta

{
  "cep": "01311200",
  "state": "SP",
  "city": "São Paulo",
  "neighborhood": "Bela Vista",
  "street": "Avenida Paulista",
  "ibge": 3550308,
  "ddd": "11",
  "timezone": "America/Sao_Paulo",
  "latitude": -23.5614,
  "longitude": -46.6558
}

🛠️ API Completa

findByCep(cep)

Busca um endereço pelo CEP. Aceita qualquer formato ("01001000", "01001-000").

const address = findByCep('74740-300');
// Address | null

findByAddress(params)

Busca endereços por trecho do logradouro. Suporta filtro por estado e limite de resultados.

const results = findByAddress({ street: 'XV de Novembro', state: 'PR', limit: 10 });
// Address[]

| Parâmetro | Tipo | Obrigatório | Descrição | |-----------|----------|-------------|---------------------------------------| | street | string | Sim | Trecho do logradouro | | state | string | Não | Sigla do estado (ex: "SP") | | limit | number | Não | Máximo de resultados (padrão: 10) |


🛡️ Tipagem (TypeScript)

A biblioteca exporta todas as interfaces para facilitar a tipagem:

import type { Address, FindByAddressParams, BrasilCepsConfig } from 'brasil-ceps-offline';

⚖️ Licença e Fonte dos Dados

Código fonte: MIT License

Dados: Baseados no Cadastro Nacional de Endereços do Censo 2022 (IBGE). Dados públicos de uso livre.