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

@griddle/core

v0.1.10

Published

Headless grid/canvas engine. Zero runtime dependencies.

Readme

@griddle/core

Headless grid/canvas engine — pure TypeScript, zero runtime dependencies.

@griddle/core is the logic half of Griddle: tile placement, movement, swap/push resolution, compaction (gravity), virtualization, loop/infinite-canvas math, and serialization. It has no rendering and no framework ties, so you can run it anywhere — in a browser, on a server, or behind one of the framework adapters.

Install

npm install @griddle/core

Usage

import { Grid } from '@griddle/core';

const grid = new Grid({ cols: 12, rows: 12, unitWidth: 75, unitHeight: 75 });

grid.addTile({ id: 't1', col: 0, row: 0, w: 2, h: 2 });
grid.moveTile('t1', { col: 4, row: 4 }); // resolves collisions via rules 1–6

const json = grid.toJSON(); // serialize
grid.loadJSON(json);        // restore

Layout invariant

Ordinary in-flow tiles must always use positive integer footprints, remain fully inside the configured grid, and never overlap. The constructor, addTile(), updateConfig(), reflow(), and loadJSON() reject illegal geometry without partially mutating the grid. Use addTileWithDisplacement() when adding at an occupied position and you want Griddle to move neighboring tiles into legal slots.

absolute and fixed tiles are intentionally out of flow, so they remain exempt from grid-cell collision and containment checks.

Adapter animation configuration

Core stores and normalizes the animation settings shared by the React, Vue, and Svelte adapters. It remains headless and never accesses the DOM itself.

const grid = new Grid({
  cols: 12,
  rows: 12,
  unitWidth: 75,
  unitHeight: 75,
  animation: {
    enabled: true,
    repositionDurationMs: 320,
    repositionEasing: 'cubic-bezier(0.22, 1, 0.36, 1)',
    liftDurationMs: 160,
    liftEasing: 'cubic-bezier(0.22, 1, 0.36, 1)',
    respectReducedMotion: true,
  },
});

Set enabled: false to disable all adapter animations, or set an individual duration to 0 to disable only that transition.

Concepts

  • Unit — a fixed unitWidth × unitHeight cell.
  • Gridcols × rows; either axis can be Infinity for an infinite canvas.
  • Tile — an object at (col, row) with a w × h footprint.
  • Repack — after a move, tiles resolve collisions via a deterministic ruleset.
  • Compaction — optional gravity that backfills gaps toward a chosen edge.
  • Loop — optional infinite-gallery mode with drag-to-pan physics.

Framework adapters

Thin presentation layers built on this core:

See the full movement ruleset and loop mode docs, or the main repository.

License

MIT © Trustybits