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

@decoy9697/a-star

v2.0.1

Published

An a* solver

Readme

A Star

Build Coverage Downloads Size

npm install @decoy9697/a-star

The library presumes you have some kind of linked structure with a start Node and a goal Node. The Node structure can be whatever you like.

Options

You will need to provide an options object to the aStar function, with the following keys:

| Key | Type | Description | | --------------- | ------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | start | Node | The starting node | | goal | Node | The goal node. The algorithm will attempt to make an array of nodes from the start to the goal. | | getId | Node => string | A function for that identifies a node using a string | | getNeighbours | Node => Array<Node> | A function that finds the directly connected nodes for a given node. NOTE. The returned nodes will be used as Map keys, so these ought to be references to the nodes in the graph. | | eqNode | (Node, Node) => boolean | A function for comparing two nodes (true if they are the same) | | heuristic | (Node, Node) => number | A function that determines the cost of travelling from one node to the other. |

Return type

| Key | Type | Description | | ------------- | ------------- | --------------------------------------------------------------- | | path | Array<Node> | The path from the start to the goal (if possible) | | reachedGoal | boolean | true, given the algorithm found a path from start to goal |

Example

import aStar from "@decoy9697/a-star";

const result = aStar({
  start: node0,
  goal: node43,
  getId: (node) => node.id,
  getNeighbours: (node) => { ... },
  eqNode: (nodeA, nodeB) => { ... },
  heuristic: (nodeA, nodeB ) => { ... }
});

if (result.reachedGoal) {
  console.log('Path': result.path);
  } else {
  console.log('Did not reach goal');
}