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

@bible-strong/avatar-core

v0.1.0

Published

Framework-independent runtime for Bible Strong procedural avatars.

Readme

@bible-strong/avatar-core

Framework-independent validation, semantic playback and renderer-neutral SVG scene generation for Bible Strong procedural avatars. The package has no React, DOM, Motion or browser-storage dependency.

Install and validate

pnpm add @bible-strong/avatar-core

Use parseAvatarDefinition for untrusted JSON text. It enforces the 256 KiB/depth limits and detects duplicate object keys before validating against the v1 schema. Use validateAvatarDefinition when the value is already materialized.

import { parseAvatarDefinition } from '@bible-strong/avatar-core'

const parsed = parseAvatarDefinition(jsonText)
if (!parsed.ok) {
  throw new Error(`${parsed.errors[0].path}: ${parsed.errors[0].message}`)
}
const definition = parsed.value

Both functions return a non-mutating discriminated result. Successful values are deeply frozen; errors include an RFC 6901 JSON Pointer, code and message. The committed JSON Schema is exported as @bible-strong/avatar-core/schema.

Definitions from the earlier pre-release runtime export may still contain standardAnimationSet: 1; the marker is accepted for compatibility but does not add any implicit animations.

Semantic lookup and playback

Public calls use semantic keys only. resolveExpression and resolveAnimation return typed errors for keys that are not present in the validated definition. Every animation is explicit in the definition, so the JSON remains the single source of truth for what an avatar can play.

import {
  advanceAvatarPlayback,
  playAvatarAnimation,
  renderAvatarFrame,
} from '@bible-strong/avatar-core'

const started = playAvatarAnimation(definition, 'idle', 0)
if (!started.ok) throw new Error(started.error.message)

const state = advanceAvatarPlayback(definition, started.value, 500, {
  random: () => 0.5,
})
const scene = renderAvatarFrame(definition, state, 500, {
  random: () => 0.5,
  reduceMotion: false,
})

advanceAvatarPlayback is a pure state transition driven by a monotonic timestamp and injected random source. The timeline for each step is transition then hold. pauseAvatarPlayback and resumeAvatarPlayback preserve exact progress. With reduceMotion: true, transitions and ambient motion jump deterministically to their target while configured blinks remain active.

renderAvatarDefinition renders a static semantic expression. renderAvatarFrame renders an animated frame. Both return paths, visibility and resolved colors without creating DOM nodes.

Entry points

  • @bible-strong/avatar-core: contract, validation, semantic catalog, playback and scene APIs.
  • @bible-strong/avatar-core/schema: the v1 Draft 2020-12 JSON Schema.
  • @bible-strong/avatar-core/geometry, /body, /surfaces, /ambient-motion: advanced pure primitives for renderer authors.

Application integrations are kept in separate packages: @bible-strong/avatar-react renders with React 19, while @bible-strong/avatar-web mounts the same definition directly into the DOM. Both depend on this package and use the same playback and scene implementation.

The package follows Semantic Versioning. While it remains below 1.0.0, breaking API changes increment the minor version and fixes increment the patch version.