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

@daniel-qolami/map-adapter

v0.1.8

Published

A Map component that acts as an adapter to choose between different maps

Readme

Map Adapter

npm version npm downloads License Nuxt

Reusable local Nuxt 4 map module for this workspace.

  • ✨  Release Notes
  • GitHub: https://github.com/DanielQolami/map-adapter
  • npm: https://www.npmjs.com/package/@daniel-qolami/map-adapter

!!! important. because of leaflet's distribution as a UMD/commonJS library, the leaflet portion of this adapter doesn't work. You can only work with "openLayers", only. (until today, I have added openLayers and leaflet)

if you want to use leaflet, download the code, place it inside your nuxt project, inside "modules" directory. It will work. (but it won't work when built as a npm package)


What it is

This module exports a MapAdapter component that acts as an adapter facade for using Leaflet and OpenLayers behind a common API, so the app shell stays provider-agnostic.

Features

  • ⛰ Keep map-specific code isolated from the app shell
  • 🚠 Expose a clean BaseMap component to pages and features
  • 🌲 Support multiple rendering providers behind one public facade (MapAdapter)
  • 🔧 Keep provider-only implementation details under the module library layer

Goals

  • keep map-specific code isolated from the app shell
  • expose a clean BaseMap component to pages and features
  • support multiple rendering providers behind one public facade
  • keep provider-only implementation details under the module library layer

External packages used by this module

  • @nuxtjs/leaflet → Leaflet runtime integration
  • leaflet and leaflet.markercluster → map rendering and marker clustering
  • ol → OpenLayers adapter support
  • @iconify/utils → marker/icon normalization helpers
  • @vueuse/nuxt → browser-friendly composables used by runtime pieces
  • defu → safe Nuxt/Vite option merging

Public surface

Components

  • MapAdapter (provider facade / adapter component)

Types

Public contracts live in the module at runtime/app/types/map.types.ts and are surfaced through the app DX shim:

import type { MapMarker } from "#imports";

Internal structure

  • runtime/app/components → public auto-registered components
  • runtime/app/types → public shared contracts used by the app
  • runtime/app/lib/map → internal map implementation details

Key internals:

  • lib/map/map.constants.ts → normalized defaults and theme config
  • lib/map/map.utils.ts → marker/cluster normalization helpers
  • lib/map/map-icon.utils.ts → Iconify-to-marker asset generation
  • lib/map/adapters/leaflet → Leaflet renderer
  • lib/map/adapters/ol → OpenLayers renderer
  • lib/map/map-adapter.types.ts → Component types (props, emits, slots)

Quick Setup

Install the module to your Nuxt application with one command:

pnpm add @daniel-qolami/map-adapter

add it manually in nuxt.config.ts:

export default defineNuxtConfig({
  modules: ["@daniel-qolami/map-adapter"],
});

Then use MapAdapter in your pages/components as provided by the module.

Example usage (suggested)

Use the adapter facade as the provider-agnostic entry point:

<script setup lang="ts">
const mapCenter = { lat: 34.0522, lng: -118.2437 }; // Los Angeles (GTA V vibe)

const pointsOfInterest: MapMarker[] = [
  {
    id: 1,
    coords: { lat: 34.0522, lng: -118.2437 },
    icon: "i-lucide-coffee",
    title: "Bean Machine",
    description: "Best coffee in LS",
  },
  {
    id: 2,
    coords: { lat: 34.053, lng: -118.24 },
    icon: "i-lucide-utensils",
    title: "Burger Shot",
    description: "Bleeder burger meal",
  },
];

function handleMarkerClick(marker: MapMarker) {
  console.info("Clicked:", marker.title);
}
</script>

<template>
  <div class="my-40 h-200 px-16">
    <MapAdapter
      provider="leaflet"
      theme="standard"
      :center="mapCenter"
      :markers="pointsOfInterest"
      :zoom="14"
      @marker-click="handleMarkerClick"
    />
  </div>
</template>

(Refer to the module’s runtime components for the exact props/slots.)

Contribution

# Install dependencies
npm i
// or
pnpm i

# Generate type stubs
npm run dev:prepare
// or
pnpm dev:prepare

# Develop with the playground
npm run dev
// or
pnpm dev

# Build the playground
npm run dev:build
// or
pnpm dev:build

# Run ESLint
npm run lint
// or
pnpm lint

# Run Vitest
npm run test
npm run test:watch
// or
pnpm test
pnpm test:watch

# Release new version
npm run release
// or
pnpm release