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

simple-pathfinder

v1.0.2

Published

A simple pathfinding library

Readme

Pathfinder

Pathfinder is a simple Node.js/TypeScript library that allows you to create a grid complete with traversable and non-traversable blocks, then plot a path between two points.

The pathfinding algorithm is loosely based upon the A* algorithm, operating by exploring adjacent blocks but favouring those that provide the shortest line-of-sight to the destination. The resultant paths are fairly accurate, although do sometimes contain interesting anomalies such as looping back on themselves, making the library suitable for pathfinding that aims to mimic that undertaken by a human.

Installation

$ npm install --save simple-pathfinder

Usage

Basic usage is as follows:

import { Pathfinder, Block, INavigationPathOptions, NavigationPath } from 'simple-pathfinder';

let width: number                   = 100;  // Number of blocks wide
let height: number                  = 50;  // Number of blocks tall
let obstacles: string[]             = ['2,10', '2,11', '33,24'];  // Array of x,y coordinates
let pathfinder: Pathfinder          = new Pathfinder(width, height, obstacles);
let start: Block                    = pathfinder.getBlockAtCoordinates(13, 5);  // x, y
let finish: Block                   = pathfinder.getBlockAtCoordinates(75, 47);  // x, y
let options: INavigationPathOptions = {allowDiagonals: true};  // Whether to allow diagonal movement
let solution: NavigationPath        = pathfinder.getNavigationPath(start, finish, options);

In the above example, the solution variable has two useful properties: path, which is an array of all blocks that comprise the final path; and explored, which is an array of all blocks explored, in the order that they were visited.

If it is easier to define a list of coordinates that are not blocked, pass true as a fourth argument to new Pathfinder().

If a path cannot be found an exception will be thrown by getNavigationPath().

If obstacles regularly move, their blocked state can be set in the following manner:

pathfinder.getBlockAtCoordinates(4, 12).isBlocked = true;