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

obf-utils

v0.1.2

Published

TypeScript utility library for working with the Open Board Format (OBF) standard

Readme

OBF Utils

npm version License: MIT

A type-safe TypeScript utility library for working with the Open Board Format (OBF)—the open standard for AAC (Augmentative and Alternative Communication) boards.


Table of Contents


Features & Benefits

  • Universal: Read, create, and modify OBF/OBZ files for AAC board sharing.
  • Type-Safe: Immutable API with full TypeScript support.
  • Cross-Platform: Works in browsers and Node.js.
  • Open Source: MIT licensed, easy to contribute to.
  • Validate, create, and modify boards, buttons, images, and layouts.
  • Pack/Unpack OBZ (zip) files.
  • Persist boards in browser or Node.js storage.
  • Schemas and validation with Zod.

Installation

npm install obf-utils
  • Requires Node.js >=20.0.0

Quick Start

import { createBoard, addButton, addImage, validateBoard } from "obf-utils";

const board = createBoard({
  name: "My Board",
  locale: "en",
  rows: 2,
  columns: 2,
});

const boardWithImage = addImage(board, {
  id: "img1",
  url: "https://example.com/happy.png",
  width: 100,
  height: 100,
});

const boardWithButton = addButton(boardWithImage, {
  id: "btn1",
  label: "Happy",
  image_id: "img1",
});

const result = validateBoard(boardWithButton);
console.log(result.success ? "Valid!" : `Error: ${result.error}`);

Usage & API

Core Concepts

  • Board: Grid layout with buttons and resources.
  • Button: Interactive board element.
  • Image/Sound: Media resources linked to buttons.
  • OBZ: Zipped OBF package.
  • Manifest: OBZ metadata file.

API Overview

Board Manipulation

| Function | Description | | --------------------------------------- | -------------------------------------- | | createBoard(options) | Create a new board. | | addButton(board, button) | Add a button to a board. | | updateButton(board, buttonId, button) | Update a button on a board. | | removeButton(board, buttonId) | Remove a button from a board. | | addImage(board, image) | Add an image to a board. | | updateImage(board, imageId, image) | Update an image on a board. | | removeImage(board, imageId) | Remove an image from a board. | | addSound(board, sound) | Add a sound to a board. | | updateSound(board, soundId, sound) | Update a sound on a board. | | removeSound(board, soundId) | Remove a sound from a board. | | updateGrid(board, { rows, columns }) | Change the board's grid size. | | validateBoard(board) | Validate a board against the OBF spec. |

OBZ & Manifest Manipulation

| Function | Description | | -------------------------------------------- | ------------------------------------------ | | createObz(options) | Create a new OBZ package. | | addBoard(obz, board) | Add a board to an OBZ. | | removeBoard(obz, boardId) | Remove a board from an OBZ. | | updateRootBoard(obz, boardId) | Set the root board in an OBZ. | | createManifest(options) | Create a new manifest. | | updateManifestRoot(manifest, boardId) | Set the root board in a manifest. | | addBoardToManifest(manifest, board) | Add a board to a manifest. | | removeBoardFromManifest(manifest, boardId) | Remove a board from a manifest. | | validateManifest(manifest) | Validate a manifest. | | validateObz(obz) | Validate an OBZ package. |

Storage (Browser & Node.js)

| Function | Description | | ------------------------ | -------------------------------- | | createStorage(options) | Create a custom storage adapter. | | saveBoard(board) | Persist a board (async). | | loadBoard(id) | Load a board by ID (async). | | deleteBoard(id) | Delete a board by ID (async). | | listBoards() | List all saved boards (async). | | saveObz(obz) | Persist an OBZ package (async). | | loadObz(id) | Load an OBZ by ID (async). | | deleteObz(id) | Delete an OBZ by ID (async). | | listObzs() | List all saved OBZs (async). |

Archive (Packing/Unpacking)

| Function | Description | | ------------------------- | ---------------------------------------------------- | | packObz(boards) | Pack boards/resources into an OBZ file (Uint8Array). | | unpackObz(data) | Unpack an OBZ file into boards/resources. |

Utilities

| Function | Description | | ------------------------------ | ---------------------------------------- | | detectEnvironment() | Detect if running in browser or Node.js. | | isBrowser(), isNode() | Environment checks. | | generateId() | Generate a random ID. | | generateUniqueId(collection) | Generate a unique ID for a collection. |

Errors

| Class | Description | | ----------------- | ------------------------------------ | | ObfError | Base error class. | | ValidationError | Thrown on validation errors. | | StorageError | Thrown on storage errors. | | ArchiveError | Thrown on archive/packing errors. | | BoardError | Thrown on board manipulation errors. | | ObzError | Thrown on OBZ/manifest errors. |

See examples/ for more usage patterns and details.


Advanced Usage

import { packObz, unpackObz } from "obf-utils";

const obzData = packObz([boardWithButton]);
const { boards, manifest } = unpackObz(obzData);
console.log(`Root board: ${manifest.root}`);
console.log(`Number of boards: ${Object.keys(boards).length}`);
import { saveBoard, loadBoard } from "obf-utils";

await saveBoard(boardWithButton);
const loadedBoard = await loadBoard(boardWithButton.id);
import { updateGrid } from "obf-utils";

const largerBoard = updateGrid(boardWithButton, { rows: 3, columns: 3 });

Architecture

src/
├── board/     # Board creation, modification, validation
├── obz/       # OBZ packaging, manifest, validation
├── schema/    # TypeScript types and schemas
├── storage/   # Pluggable storage (browser/Node.js)
├── utils/     # Utility functions (ID, env)
└── errors/    # Custom error classes

All APIs are immutable and type-safe. Validation uses Zod.


Documentation & Resources


Environment Support

  • Browser: Uses IndexedDB for storage
  • Node.js: Uses filesystem for storage
  • Auto-detects environment

Community & Support


Contributing

We welcome contributions! Please see CONTRIBUTING.md for guidelines, code of conduct, and the release/commit workflow.


Changelog

See Releases for version history.


License

MIT