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

@blakron/spine

v0.2.0

Published

Spine 4.x runtime for the Blakron engine

Readme

@blakron/spine

Spine 4.2 runtime for the Blakron engine.

Ports the egret-spine adapter to @blakron/core, replacing Egret's Mesh / Texture / RES APIs with their Blakron equivalents. The Spine runtime itself is provided by the official @esotericsoftware/spine-core npm package.

Installation

pnpm add @blakron/spine

Usage

import { createPlayer } from '@blakron/core';
import {
	SkeletonAnimation,
	BlakronAssetManager,
	SkeletonBinary,
	AtlasAttachmentLoader,
	TextureAtlas,
} from '@blakron/spine';

// 1. Create Blakron player
const app = createPlayer({ canvas, frameRate: 60, contentWidth: 640, contentHeight: 480 });

// 2. Load assets
const mgr = new BlakronAssetManager('assets/spine/');
mgr.loadTextureAtlas('hero.atlas');
mgr.loadBinary('hero.skel');

// 3. Poll until complete
function waitForLoad() {
	if (!mgr.isLoadingComplete()) {
		requestAnimationFrame(waitForLoad);
		return;
	}
	if (mgr.hasErrors()) {
		console.error(mgr.getErrors());
		return;
	}

	// 4. Build skeleton data
	const atlas = mgr.require('hero.atlas') as TextureAtlas;
	const binary = new SkeletonBinary(new AtlasAttachmentLoader(atlas));
	binary.scale = 0.5;
	const skelData = binary.readSkeletonData(mgr.require('hero.skel') as Uint8Array);

	// 5. Create display object and add to stage
	const hero = new SkeletonAnimation(skelData);
	hero.x = 320;
	hero.y = 480;
	app.stage.addChild(hero);
	app.start();

	// 6. Play animations
	hero.play('walk', 0); // loop forever
	hero.play('attack', 1); // play once
	hero.setMix(0.2, 'walk', 'attack'); // cross-fade

	// Promise-based sequencing
	const track = hero.start(0);
	track.add('idle', 0);
	await track.waitPlayEnd();
	track.add('run', 3);
}
requestAnimationFrame(waitForLoad);

API

SkeletonAnimation

The main display object. Extends Sprite from @blakron/core.

| Method | Description | | --------------------------------------- | ------------------------------------------------------------------- | | play(anim, loop, trackID?, listener?) | Play an animation. loop=0 = loop forever, loop=N = play N times | | playDefault(anim?, loop, trackID?) | Play first animation if anim omitted | | playList(animList, loop, trackID?) | Queue multiple animations | | playAll(loop, trackID?) | Queue all animations in skeleton data | | playRandom(trackID?) | Play a random animation | | start(trackID?) | Reset pose and return a new Track for the given track | | stop(trackID) | Clear a single track | | stopAll(reset?) | Clear all tracks; optionally reset to setup pose | | setMix(time, from?, to?) | Set cross-fade mix time | | setSkinByName(name) | Switch skin and reset to setup pose | | getAllSkinNames() | List all skin names | | setTimeScale(scale) | Global time scale for all animations | | flipX / flipY | Mirror the skeleton |

Track

Returned by SkeletonAnimation.start(). Manages an animation queue on a single Spine track.

| Method | Description | | ---------------------------- | ------------------------------------------------- | | add(name, loop, listener?) | Append an animation to the queue | | setToLastFrame() | Jump the track entry to its last frame | | waitPlayStart() | Promise — resolves when the animation starts | | waitPlayEnd() | Promise — resolves when all loops finish | | waitLoopStart() | Promise — resolves at the start of each loop | | waitLoopEnd() | Promise — resolves at the end of each loop | | waitInterrupt() | Promise — resolves when the track is interrupted | | waitTrackEnd() | Promise — resolves when the queue is exhausted | | waitEvent() | Promise — resolves on the next Spine frame event | | waitNamedEvent(name) | Promise — resolves when a named frame event fires |

BlakronAssetManager

Loads Spine assets using @blakron/core's HttpRequest and ImageLoader.

| Method | Description | | ------------------------------------------ | -------------------------------------------------- | | loadTextureAtlas(path, success?, error?) | Load .atlas + page textures | | loadBinary(path, success?, error?) | Load .skel binary | | loadJson(path, success?, error?) | Load .json skeleton | | loadText(path, success?, error?) | Load raw text | | isLoadingComplete() | Returns true when all pending loads finish | | hasErrors() | Returns true if any load failed | | getErrors() | Map of path → error message | | require(path) | Get a loaded asset, throws if not found | | get(path) | Get a loaded asset, returns undefined if not found |

Spine version compatibility

The Spine editor version must match the runtime version. This package uses @esotericsoftware/spine-core ^4.2. Export your skeletons from Spine 4.2.

Running the example

pnpm example

Opens a Vite dev server at http://localhost:5173 with a spineboy demo. Place your Spine 4.2 assets in example/assets/.

License

MIT (adapter layer) — Spine runtime is © Esoteric Software LLC, see Spine Runtimes License.