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

piri

v1.3.2

Published

A lightweight utility to create beautiful, stylized SVG maps with a bring-your-own-styles mentality. Heavily based on the [Dotted Map](https://github.com/NTag/dotted-map/tree/main) library, with more customization.

Readme

piri

A lightweight utility to create beautiful, stylized SVG maps with a bring-your-own-styles mentality. Heavily based on the Dotted Map library, with more customization.

a dotted map on an abstract background


Installation

pnpm install piri

Usage

import { createMap } from "piri";

const { points, addMarkers } = createMap({
  width: 150,
  height: 75,
});

It's that simple. points represents land mass, addMarkers projects your markers onto the same coordinate space.

Options

| Option | Type | Default | Description | |---|---|---|---| | width | number | required | Width of the SVG viewBox. | | height | number | required | Height of the SVG viewBox. | | grid | "diagonal" \| "vertical" | "vertical" | vertical | The arrangement of the points | | mapSamples | number | 6000 | Grid cells sampled. Higher = denser dots. | | radius | number | 0.3 | Base dot radius in viewBox units. Controls edge margin (radius * 1.25). | | countries | CountryCode[] | undefined | ISO 3166-1 alpha-3 codes (e.g. ["USA", "CAN"]). Auto-fits the region to the bounding box. | | region | Region | auto | Custom lat/lng bounding box. Overrides the auto-fit from countries. Latitudes clamped to [-85, 85] (Web Mercator limit). |

Markers

By default addMarkers expects an array with, at minimum, the latitude and longitude of your markers, and an optional size parameter, which you can then use to set a custom radius per marker.

const markers = addMarkers([
  { 
    lat: 40.7128, 
    lng: -74.006, 
    size: 0.4
  }, // New York
  { lat: 51.5074, 
    lng: -0.1278 
  }, // London
]);

Expanding the output

addMarkers is generic, and any extra properties you pass in are inferred and fully typed in the output.

const markers = addMarkers([
  { 
    lat: 40.7128, 
    lng: -74.006, 
    size: 2
    visited: true
  }, // New York
  { lat: 51.5074, 
    lng: -0.1278 
    visited: false
  }, // London
]);

Rendering

After these steps, render the map as an SVG, with whatever customizations you need. This example uses React:

export const DottedMap = () => {
  const { points, addMarkers } = createMap({ width: 150, height: 75 })

  const markers = addMarkers([
    { lat: 40.7128, lng: -74.006, size: 0.5, visited: true },
    { lat: 51.5074, lng: -0.1278, size: 0.5, visited: false },
  ])

  return (
    <svg viewBox="0 0 150 75" style={{ width: '100%', height: '100%' }}>
      {points.map((point) => (
        <circle
          cx={point.x}
          cy={point.y}
          r={0.25}
          fill="#ccc"
          key={`${point.x}-${point.y}`}
        />
      ))}
      {markers.map((marker) => (
        <circle
          cx={marker.x}
          cy={marker.y}
          r={marker.size ?? 0.25}
          fill={marker.visited ? '#4A0404' : '#999'}
          key={`${marker.x}-${marker.y}`}
        />
      ))}
    </svg>
  )
}

Caching

Point calculations are cached automatically.