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

paperairplanes

v0.1.0

Published

Tiny library for interactive paper-plane SVGs — hand-rolled SVG paths, zero dependencies, ~1 KB gzipped

Readme

paperplanes.js

Tiny library for interactive paper-plane SVGs. Hand-rolled SVG path generation — no canvas, no WebGL, no runtime dependencies.

Performance

  • ~1 KB gzipped — single file, single export, zero dependencies
  • Pure string output — generates SVG markup via template literals; no DOM manipulation, no virtual DOM diffing
  • Hand-rolled SVG paths — geometry computed inline with basic trigonometry; no SVG framework overhead
  • Stateful by design — random geometry is computed once at creation; re-pointing only recalculates the fold

Install

npm install paperplanes

Quick start

import { Plane } from "paperplanes";

const plane = Plane();

document.body.innerHTML = plane.point();

API

Plane(opts?)

Creates a paper plane with random triangle geometry. Returns an object with a .point() method.

const plane = Plane();
const plane = Plane({ fill: "#D0E8FF", foldFill: "#A8D1FF" });

Options:

| Option | Default | Description | | ----------- | -------------------- | ------------------------------- | | fill | "#E8DEF8" | Fill colour of the plane body | | foldFill | "#D0BCFE" | Fill colour of the fold | | foldDepth | 12 | How far the fold extends | | stroke | "black" | Stroke colour | | viewBox | "-15 -15 130 150" | SVG viewBox attribute |

plane.point(x?, y?)

Returns an SVG string with the plane's fold pointed toward (x, y) in coordinate space. The fold appears on the corner closest to the cursor.

plane.point()        // default position (50, 0)
plane.point(x, y)    // fold toward cursor

Example: full-page grid

<div id="grid"></div>

<script type="module">
  import { Plane } from "./paperplanes.js";

  const cols = Math.round(window.innerWidth / 100);
  const rows = Math.round(window.innerHeight / 100);

  const grid = document.getElementById("grid");
  grid.style.display = "grid";
  grid.style.gridTemplateColumns = `repeat(${cols}, 1fr)`;
  grid.style.gridTemplateRows = `repeat(${rows}, 1fr)`;
  grid.style.width = "100vw";
  grid.style.height = "100vh";

  const planes = [];

  for (let i = 0; i < rows * cols; i++) {
    const plane = Plane();
    const el = document.createElement("div");
    el.innerHTML = plane.point();
    el.querySelector("svg").style.cssText = "width:100%;height:100%;display:block";
    grid.appendChild(el);
    planes.push({ el, plane });
  }

  document.addEventListener("pointermove", (e) => {
    for (const { el, plane } of planes) {
      const rect = el.getBoundingClientRect();
      const x = ((e.clientX - rect.left) / rect.width) * 100;
      const y = ((e.clientY - rect.top) / rect.height) * 100;
      el.innerHTML = plane.point(x, y);
    }
  });
</script>

License

MIT