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

datamicron_dsm-map-sdk

v1.0.7

Published

A custom Leaflet-based map SDK

Readme

📦 dsm-map-sdk · Leaflet Map SDK for Web Apps ·

A lightweight, extensible Leaflet-based SDK for rendering interactive maps with support for GeoJSON layers, markers, circles, polygons, fullscreen control, and copyable coordinates via context menu.

Built with TypeScript. Ideal for dashboards, location tracking, analytics, and more.

Features

  • GeoJSON layer support with auto-zoom
  • Interactive markers, circles, and polygons
  • Fullscreen control
  • Right-click context menu to copy coordinates
  • TypeScript support with full type definitions

Installation

npm i datamicron_dsm-map-sdk

🧠 Usage Example (React + TypeScript)

import { MapSDK } from 'datamicron_dsm-map-sdk';
import React, { useEffect, useRef } from 'react';

function App() {
  const mapContainerRef = useRef<HTMLDivElement | null>(null);
  const mapInstanceRef = useRef<MapSDK | null>(null);

  useEffect(() => {
    if (!mapContainerRef.current) return;

    mapInstanceRef.current = new MapSDK({
      container: mapContainerRef.current,
      configuration: {
        map: {
          coordinates: { latitude: 40.7128, longitude: -74.006 },
          defaultZoom: 10,
        },
        tile: {
          url: "https://tile.openstreetmap.org/{z}/{x}/{y}.png",
          attribution: "&copy; OpenStreetMap contributors",
        },
        contextMenu: {
          enabled: true,
          onCopyCoordinates: (coordinates) => {
            console.log('Copied coordinates:', coordinates);
            // You can also show a notification here
          },
        },
      },
    });

    mapInstanceRef.current.addGeoJson({
      geojson: {},// your geoJson data
      sdkOptions: { autoZoom: true },
    });

    return () => {
      mapInstanceRef.current?.destroy();
      mapInstanceRef.current = null;
    };
  }, []);

  return (
    <div style={{ width: "100%", height: "100%" }}>
      <div
        ref={mapContainerRef}
        style={{
          width: "100%",
          height: "100vh",
          border: "1px solid #ccc",
          borderRadius: "8px",
        }}
      />
    </div>
  );
}

export default App;

Context Menu Feature

The SDK now supports right-click context menu to copy coordinates:

How it works:

  1. User right-clicks anywhere on the map
  2. A context menu appears showing the coordinates at that point
  3. User clicks on "Copy (lat, lng)" to copy the coordinates to clipboard
  4. Optional callback is triggered with the copied coordinates

Configuration:

contextMenu: {
  enabled: true, // Enable/disable context menu
  onCopyCoordinates: (coordinates) => {
    // This callback is called when user copies coordinates
    console.log('Latitude:', coordinates.latitude);
    console.log('Longitude:', coordinates.longitude);
    // You can show a toast notification, update state, etc.
  }
}

Example with notification:

contextMenu: {
  enabled: true,
  onCopyCoordinates: (coordinates) => {
    // Show success message to user
    alert(`Copied: ${coordinates.latitude}, ${coordinates.longitude}`);
  }
}