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

@zakkster/lite-path

v1.0.0

Published

Zero-GC A* pathfinding. Epoch-driven O(1) resets, flat binary heap, weighted terrain support.

Readme

@zakkster/lite-path

npm version npm bundle size npm downloads npm total downloads TypeScript Dependencies License: MIT

🧭 What is lite-path?

@zakkster/lite-path is a production-grade A* pathfinder that never allocates during searches.

It gives you:

  • 🧭 A* with 4-way and 8-way movement
  • ⏱️ O(1) state reset via epoch tracking (no .fill() per search)
  • 📊 Flat Int32Array binary heap (cache-friendly)
  • ⛰️ Weighted terrain (cost per cell)
  • 📝 Zero-allocation path reconstruction into pre-allocated buffer
  • 🪶 < 1.5 KB minified

The epoch trick is the key: instead of clearing arrays between searches, we just bump a counter.

Part of the @zakkster/lite-* ecosystem — micro-libraries built for deterministic, cache-friendly game development.

🚀 Install

npm i @zakkster/lite-path

🕹️ Quick Start

import { Pathfinder } from '@zakkster/lite-path';

const pf = new Pathfinder(100, 100, true); // 100x100 grid, diagonals on

// Set up terrain (0 = wall, 1 = normal, >1 = expensive)
pf.grid[50 + 25 * 100] = 0; // wall at (50, 25)
pf.grid[60 + 30 * 100] = 5; // swamp at (60, 30)

// Find path
const out = new Float32Array(2000);
const waypoints = pf.findPath(10, 10, 90, 90, out);

for (let i = 0; i < waypoints; i++) {
    const x = out[i * 2], y = out[i * 2 + 1];
    drawWaypoint(x, y);
}

🧠 Why This Exists

Existing A* libraries allocate node objects and reset arrays per search. lite-path uses epoch tracking — incrementing a single integer makes all previous state stale in O(1). The flat binary heap stores indices in an Int32Array, not node objects.

📊 Comparison

| Library | Size | Reset Cost | Heap | Allocations | Install | |---------|------|-----------|------|-------------|---------| | pathfinding | ~12 KB | O(N) fill | Array-based | High | npm i pathfinding | | javascript-astar | ~5 KB | O(N) fill | Array-based | Medium | npm i javascript-astar | | lite-path | < 1.5 KB | O(1) epoch | Int32Array flat heap | Zero | npm i @zakkster/lite-path |

⚙️ API

new Pathfinder(cols, rows, allowDiagonals?)

grid: Uint8Array — Direct access. 0 = wall, 1 = walkable, >1 = weighted.

findPath(startX, startY, endX, endY, outPath) — Returns waypoint count (0 = no path). Path excludes start node.

🧪 Benchmark

100x100 grid, 1000 pathfinding calls:
  pathfinding:       45ms (node allocation + array reset)
  javascript-astar:  28ms (array reset per call)
  lite-path:         12ms (epoch bump = O(1) reset, zero alloc)

📦 TypeScript

Full TypeScript declarations included in Pathfinder.d.ts.

📚 LLM-Friendly Documentation

See llms.txt for AI-optimized metadata and usage examples.

License

MIT