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

@hfu.digital/boardkit-core

v2026.4.25

Published

Zero-dependency shared kernel for BoardKit — types, scene graph, tools, and collaboration protocol

Readme

@hfu.digital/boardkit-core

Zero-dependency shared kernel for BoardKit. Contains types, scene graph, drawing tools, collaboration protocol, and validation — all in pure TypeScript with no runtime dependencies.

Installation

bun add @hfu.digital/boardkit-core

What's Included

Types

The Element discriminated union covers all whiteboard element types:

import type { Element, StrokeElement, ShapeElement, TextElement } from '@hfu.digital/boardkit-core';
import type { Board, Page, Participant } from '@hfu.digital/boardkit-core';
import type { ClientMessage, ServerMessage } from '@hfu.digital/boardkit-core';

Scene Graph

Immutable state container for elements:

import { createScene, addElement, removeElement, updateElement, getElementsByPage } from '@hfu.digital/boardkit-core';

let scene = createScene();
scene = addElement(scene, myElement);
scene = updateElement(scene, 'el-1', { zIndex: 10 });
const pageElements = getElementsByPage(scene, 'page-1');

Tools

Abstract Tool class with state machine (idle → active → finishing → idle). Nine tools available via ToolRegistry:

import { ToolRegistry, TOOL_IDS } from '@hfu.digital/boardkit-core';

const registry = ToolRegistry.createDefault();
const pen = registry.get(TOOL_IDS.PEN);

| Tool | TOOL_IDS | Creates | |------|----------|---------| | PenTool | PEN | StrokeElement | | ShapeTool | SHAPE | ShapeElement | | TextTool | TEXT | TextElement | | StickyNoteTool | STICKY_NOTE | StickyNoteElement | | ConnectorTool | CONNECTOR | ConnectorElement | | SelectTool | SELECT | — (selection/drag) | | EraserTool | ERASER | — (delete mutations) | | LaserTool | LASER | — (preview only) | | HandTool | HAND | — (viewport pan) |

Operations

  • LWW Merge: mergeElement() / mergeScene() for conflict resolution (remote wins on tie)
  • History: Undo/redo stack with configurable max depth
  • Clipboard: Serialize/deserialize selections with relative positioning
  • Transforms: Move, resize, rotate elements

Drawing Algorithms

  • Smoothing: Catmull-Rom spline interpolation
  • Simplification: Ramer-Douglas-Peucker algorithm
  • Pressure: Pen pressure to stroke width mapping

Validation

import { validateElement, validateBoardLimits, validateAssetSize } from '@hfu.digital/boardkit-core';

const result = validateElement(untrustedData);
if (!result.valid) console.error(result.errors);

License

MIT