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

@craft-native/ts-maps

v0.0.361

Published

Craft SDK bindings for the ts-maps interactive map runtime. Provides a cross-platform MapView component backed by the MapProvider.ts_maps variant in the Zig core.

Readme

@craft-native/ts-maps

Craft SDK bindings for the ts-maps interactive map runtime.

This package is the TypeScript side of MapProvider.ts_maps in Craft's Zig core. Its MapView owns a DOM container and renders ts-maps inside a browser or WebView, with zero API keys. It is not the STX native Map component.

For a fully native STX screen, use Map, MapMarker, and MapPolyline. Craft renders them with MapKit on iOS and the configured native Android map provider. Android's mapProvider: 'maplibre' selects a key-free native GL view; it does not mount this package's DOM adapter.

Install

bun add @craft-native/ts-maps

Quick start

import { createMapView, defaultMapConfiguration, tsMapsProvider } from '@craft-native/ts-maps'

const view = createMapView({
  configuration: { ...defaultMapConfiguration, provider: tsMapsProvider },
  initialCamera: {
    center: { latitude: 37.7749, longitude: -122.4194 },
    zoom: 12,
    pitch: 0,
    heading: 0,
  },
  markers: [
    {
      id: 1,
      coordinate: { latitude: 37.7749, longitude: -122.4194 },
      title: 'San Francisco',
      subtitle: null,
      color: 'red',
      is_draggable: false,
      is_selected: false,
      custom_icon: null,
      anchor_x: 0.5,
      anchor_y: 1,
    },
  ],
  onTap: (coord) => console.log('tapped', coord),
  onMarkerTap: (id, coord) => console.log('marker', id, coord),
})

document.body.appendChild(view.container)

API overview

| Export | What it is | | --- | --- | | createMapView(props) | Factory returning a MapViewInstance with id, container, map, and imperative methods (setCamera, addMarker, fitToMarkers, …). | | MapViewProps / MapViewInstance | Types for the component. | | Coordinate, MapRegion, MapCamera, MapMarker, … | TypeScript mirrors of the structs in packages/zig/src/maps.zig. Field names match exactly so JSON round-trips are free. | | craftCoordToLatLng, latLngToCraftCoord, craftRegionToBounds, craftCameraToOptions, craftMarkerToMarker, … | Pure adapter functions between Craft and ts-maps types. | | tsMapsProvider | Constant 'ts_maps' that matches the Zig enum tag. | | Everything from ts-maps | TsMap, LatLng, Marker, Polyline, marker(), tileLayer(), etc. are re-exported so you only need one import. |

Bridge protocol

When running inside a Craft WebView, createMapView registers itself with getBridge() and listens for the methods declared in ./bridge-protocol:

  • setCamera, setRegion, addMarker, removeMarker, addPolyline, addPolygon, addCircle, fitToMarkers, selectMarker, deselectAll, setConfiguration.

It emits these events back:

  • map:tap, map:markerTap, map:regionChanged, map:cameraChanged.

If no bridge is available (browser-only, tests, etc.) the component silently falls back to local-only behavior — event callbacks passed via props still fire.

Development

bun run typecheck
bun test
bunx --bun pickier .