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

@mw-kit/mw-geocoding

v1.1.0

Published

SDK Node.js público para consumir as operações públicas de mapas da API `mw-geocoding`.

Readme

@mw-kit/mw-geocoding

SDK Node.js público para consumir as operações públicas de mapas da API mw-geocoding.

O pacote expõe a classe MwGeocodingClient como superfície pública inicial. O runtime mínimo contratado é Node.js >=20, usando fetch global ou uma implementação customizada informada nas opções.

O import público é feito pelo pacote root:

import { MwGeocodingClient } from '@mw-kit/mw-geocoding'

const client = new MwGeocodingClient({
  apiKey: 'mwg_example.key',
  baseUrl: 'https://api.example.test',
})

apiKey é a credencial runtime usada nas chamadas HTTP para a API mw-geocoding. Ela é independente de tokens npm usados por mantenedores para publicar o pacote.

As operações retornam resultado discriminado por success:

const result = await client.coordinate(
  {
    city: 'São Paulo',
    country: 'BR',
    street: 'Praça da Sé',
  },
  {
    language: 'pt-BR',
    requestId: 'request-123',
  },
)

if (result.success) {
  console.log(result.data.coordinates)
} else {
  console.error(result.error.kind, result.error.message)
}

Instalação

O pacote @mw-kit/mw-geocoding é publicado como pacote npm público no registry npm oficial. Consumidores normais não precisam configurar .npmrc com _authToken nem informar NPM_TOKEN para instalar o pacote.

pnpm add @mw-kit/mw-geocoding
npm install @mw-kit/mw-geocoding

NPM_TOKEN é um token npm usado pelo pipeline de publicação. Ele não autentica download público normal do pacote, não é API key runtime da API, não deve ser usado como valor de apiKey e não deve ter valor real gravado em arquivos versionados.

Operações

coordinate

const result = await client.coordinate({
  city: 'São Paulo',
  country: 'BR',
  minimumConfidence: 'regular',
  number: 1,
  postalCode: '01001-000',
  state: 'SP',
  street: 'Praça da Sé',
  strategies: ['database', 'mapbox'],
})

if (result.success) {
  console.log(result.data.coordinates.lat, result.data.coordinates.lng)
}

address

const result = await client.address({
  coordinates: {
    lat: -23.55052,
    lng: -46.633308,
  },
  minimumConfidence: 'high',
  strategies: ['mapbox', 'google'],
})

if (result.success) {
  console.log(result.data.address.cityName)
}

postalCode

const result = await client.postalCode({
  postalCode: '01001-000',
  requiredFields: ['ibgeCode'],
  strategies: ['database', 'brasilapi', 'viacep'],
})

if (result.success) {
  console.log(result.data.formattedPostalCode, result.data.cityName)
}

route

const result = await client.route({
  coordinates: [
    { lat: -23.55052, lng: -46.633308 },
    { lat: -23.561414, lng: -46.655881 },
  ],
  geometryFormat: 'encoded',
  strategies: ['osrm'],
})

if (result.success) {
  console.log(result.data.distance, result.data.duration)
}

matrix

const result = await client.matrix({
  coordinates: [
    { lat: -23.55052, lng: -46.633308 },
    { lat: -23.561414, lng: -46.655881 },
    { lat: -23.567, lng: -46.648 },
  ],
  optimizeBy: 'duration',
  startIndex: 0,
  strategies: ['osrm', 'google-distance'],
})

if (result.success) {
  console.log(result.data.origins)
}

O contrato público da API usado pelo SDK fica em ../api/openapi/. O client Node.js não importa módulos internos de ../api/src/.