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

sketch-map-sdk

v0.1.2

Published

Hand-drawn travel-route map renderer (support browser + Node).

Readme

sketch-map-sdk

CI

Hand-drawn / watercolor-style travel-route map renderer for China. Same API works in the browser and in Node.js (headless via jsdom + @resvg/resvg-js); the runtime is selected automatically through the package's exports conditions.

Example hand-drawn route map

The renderer takes an ordered list of WGS84 lat/lng locations and produces:

  • province washes
  • rivers passing through the visited cities
  • highlighted city polygons
  • the route with direction arrows + numbered markers
  • compass + optional title

China geo data (provinces / cities / rivers) is bundled inside the package, so no extra fetch/setup is needed at runtime.

Install

npm install sketch-map-sdk
# or
pnpm add sketch-map-sdk

Peer requirements:

  • Node.js 20+ (for the headless runtime)
  • A bundler that respects the exports field (Vite, webpack, esbuild, Rollup, Next.js, etc.) for the browser runtime

Usage

Node (PNG)

import { renderRoute } from "sketch-map-sdk";
import { writeFile } from "node:fs/promises";

const result = await renderRoute(
  {
    title: "华东行程",
    locations: [
      { name: "武汉", lat: 30.5928, lng: 114.3055 },
      { name: "黄山", lat: 30.134, lng: 118.17 },
      { name: "杭州", lat: 30.2741, lng: 120.1551 },
    ],
  },
  { kind: "png" },
);

if (result.status === "error") {
  throw new Error(result.message);
}

await writeFile("route.png", Buffer.from(await result.png.arrayBuffer()));

Browser (SVG string or PNG Blob)

import { renderRoute } from "sketch-map-sdk";

const result = await renderRoute(input, { kind: "svg" });
if (result.status === "success") {
  container.innerHTML = result.svg;
}

const png = await renderRoute(input, { kind: "png", scale: 2 });
if (png.status === "success") {
  imgEl.src = URL.createObjectURL(png.png);
}

Input schema

import { RouteInputSchema, type RouteInput } from "sketch-map-sdk";

const input: RouteInput = RouteInputSchema.parse(json);

| Field | Required | Constraint | | ------------------ | -------- | ----------------------------------------------------------- | | locations | yes | 1–50 ordered items (controls route arrows + marker numbers) | | locations[].name | yes | Short label drawn next to the marker | | locations[].lat | yes | -90 to 90, WGS84 | | locations[].lng | yes | -180 to 180, WGS84 | | title | no | Up to 60 chars, drawn at the top | | width | no | 400–2000 px, default 800 | | height | no | 300–2000 px, default 600 |

The PNG is rasterized at 2× the SVG viewBox size unless target.scale is set.

renderRoute never throws — failures surface as { status: 'error', message, cause }.

Coverage

Mainland China only (WGS84). Locations outside China will not match the province / city outlines and will appear under summary.unmatchedLocations.

Develop

pnpm install
pnpm build         # tsc + copy src/core/data/*.json to dist/core/data/
npm pack --dry-run # inspect tarball contents