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

seeded-maze

v0.3.0

Published

Engine-agnostic, deterministic maze generation: seeded grid mazes, rail-node geometry, multi-layer topology with provable solvability, and curved-wall outlines.

Readme

seeded-maze

CI npm license

Deterministic maze generation for games and tools. Pure data in and out: no rendering library types, no globals you have to reset, and the same seed always produces the same maze.

  • Seeded grid mazes. generateMaze(width, height, seed) returns a MazeLayout (cells, passages, centre, perimeter exits). Dimensions are forced odd so the centre is shared.
  • Rail-node geometry. buildGeometry(layout, config) turns a layout into wall segments, floor and ceiling tiles and a rail-node graph; gridToWorld / worldToGrid convert between grid and world space.
  • Multi-layer topology. generateLayeredMaze({ layers, width, height, seed }) stacks layers joined by stair, drop and jump connectors, and assertSolvable proves the goal is reachable from the entry across layers. findDeadEnds reports dead ends and how far each sits from the solution path.
  • Curved-wall outlines. buildCurvedWalls smooths and wobbles the wall lines into polylines, clamped so a curve can never open a walled boundary or seal an open passage.
  • Authored module composition. composeMazeModules expands a macro maze with explicitly chosen rectangular tile modules, joins matching typed ports, preserves masks and anchors, and rejects disconnected modules or expanded grids.

Install

npm install seeded-maze
# or: pnpm add seeded-maze

Requires Node.js 22 or newer. seeded-maze ships native ESM and CommonJS entry points with format-correct TypeScript declarations, and one runtime dependency, seedrandom.

Quick start

import {
  assertSolvable,
  buildGeometry,
  DEFAULT_CONFIG,
  findDeadEnds,
  generateLayeredMaze,
  generateMaze,
} from 'seeded-maze';

// A 9 x 9 maze. The same seed gives the same layout on every run and every machine.
const layout = generateMaze(9, 9, 'daily-2026-10-07');
const geometry = buildGeometry(layout, DEFAULT_CONFIG);
console.log(geometry.walls.length, geometry.railNodes.size, findDeadEnds(layout).length);

// Three stacked layers, with a proof that the goal can be reached from the entry.
const tower = generateLayeredMaze({ layers: 3, width: 9, height: 9, seed: 'tower-1' });
console.log(assertSolvable(tower).solvable);

CommonJS works the same way:

const { generateMaze } = require('seeded-maze');

Runnable ESM and CommonJS examples are in examples/.

API overview

| Area | Exports | | --- | --- | | Layout | generateMaze, getConnections, MazeLayout, MazeCell, Passage | | Geometry | buildGeometry, getNodeConnections, gridToWorld, worldToGrid, DEFAULT_CONFIG, MazeConfig, MazeGeometry | | Curved walls | buildCurvedWalls, distanceToWall, minDistanceToWalls, maxDeviation, CurvedWall, Point2 | | Layers | generateLayeredMaze, assertSolvable, findDeadEnds, LayeredMaze, SolvabilityReport, DeadEnd | | Composition | composeMazeModules, MazeModule, ModulePlacement, ComposedMaze, ModulePort, ModuleAnchor |

The full reference is in docs/API.md; the invariants behind it are in docs/ARCHITECTURE.md.

Compatibility

  • Node.js 22 and newer, tested on the maintained lines 22, 24 and 26.
  • Plain data structures only, so it runs in browsers and workers through any bundler.
  • A seed is part of the contract: a change that alters what a seed produces is released as a breaking change.

Links

License

MIT