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

endereco-facil

v1.0.1

Published

Uma biblioteca Node.js leve, moderna e fortemente tipada para busca de **endereços com fuzzy search, CEPs e cálculo de distâncias/rotas** integrando múltiplos provedores (ViaCEP, Nominatim, CepAberto, OpenRouteService, etc.).

Readme

📍 Endereço fácil

Uma biblioteca Node.js leve, moderna e fortemente tipada para busca de endereços com fuzzy search, CEPs e cálculo de distâncias/rotas integrando múltiplos provedores (ViaCEP, Nominatim, CepAberto, OpenRouteService, etc.).

npm version TypeScript Node PRs Welcome license


🚀 Funcionalidades

  • 📮 Busca por CEP: Consulta rápida de endereços a partir do CEP.
  • 📮 Busca por coordenadas: Consulta de endereços a partir de latitude, longitude.
  • 🔍 Busca por Logradouro: Localize endereços mesmo digitados incorretamente informando Rua, Cidade e Estado.
  • 🗺️ Geocodificação: Obtenção de coordenadas (latitude e longitude).
  • 🚗 Cálculo de Distância e Tempo: Integração com OpenRouteService para matrizes de distância e tempo em rotas (a pé, moto, carro, etc.).

🚀 Instalação

npm install endereco-facil
# ou
yarn add endereco-facil

💻 Casos de uso

  1. Inicializando o Cliente
import { AddressClient } from "endereco-facil";

const client = new AddressClient({
    // obrigatório para acessar as Apis
    userAgent: {appName: "MinhaAplicacao", appVersion: "1.0", email: "[email protected]",
    // se quiser limitar os provedores, inclua a prop "providers"
    providers: ["viaCep", "nominatim", "openRouteService", "cepAberto"],
    // essa prop abaixo delimita as buscas a um determinado rerângulo
    areaDeBusca: [number, number, number, number];
    // para usar os serviços do cepAberto e do openRouteService, inclua as variáveis de ambiente
    credenciais: {
        openRouteService: process.env.ORS_API_KEY, // Obtenha em https://account.heigit.org/manage/key
        cepAberto: process.env.CEP_ABERTO_TOKEN, // Obtenha em https://www.cepaberto.com/api_key
    },

});
  1. Consulta por CEP
// pesquisa simples por CEP.
const resultados = await client.pesquisarPorCEP("40000-000");
  1. Busca por logradouro / Fuzzy Search
// Essa função ajuda com o autocomplete, 
// é necessário bairro, cidade e estado para ajudar na pesquisa.
const resultados = await client.pesquisarPorRua({
  rua: "Avenida Jequitaia",
  bairro: "Água de Meninos",
  cidade: "Salvador",
  estado: "Bahia",
});
  1. Busca por coordenadas
// Útil para pegar o endereço do usuário, sem que ele precise digitar (enviando dados de posicionamento)
// A ordem dos parâmetros deve ser [latitude, longitude]
const resultados = await client.pesquisarPorCoords([-12.981092, -38.511017])
  1. Cálculo de distância / Tempo de rota
// Origem e Destino: [Latitude, Longitude]
const origem: [number, number] = [-13.0102, -38.5124];
const destino: [number, number] = [-12.9022, -38.3321];

const rotas = await client.obterDistancia(origem, destino, "driving-car");
/*
Saída do console.log(rotas):
[
  {
    distanciaEmMetros: 23450.5,
    tempoEmSegundos: 1820.3,
    distanciaFormatada: '23,45 km',
    tempoFormatado: '30 min',
    trajetoCodificado: 'fvknApc_jFa@Ig@U[UIUAM@YLe@P]VYX...'
  }
]
*/

📄 Licença

Este projeto está sob a licença MIT. Sinta-se livre para contribuir ou utilizar em seus projetos.


👤 Autor

Feito com ☕ por Anthony Victor. Entre em contato ou confira outros projetos: Se este pacote te ajudou, considere dar uma ⭐️ no repositório!

GitHub LinkedIn