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

@talmolab/sleap-io.js

v0.1.9

Published

JavaScript/TypeScript utilities for reading and writing SLEAP `.slp` files with streaming-friendly access patterns and a lightweight data model. This is the JS companion to the Python library at https://github.com/talmolab/sleap-io.

Readme

sleap-io.js

JavaScript/TypeScript utilities for reading and writing SLEAP .slp files with streaming-friendly access patterns and a lightweight data model. This is the JS companion to the Python library at https://github.com/talmolab/sleap-io.

Intent

  • Make SLP parsing available in browsers and serverless runtimes.
  • Support streaming-first workflows for large .slp/.pkg.slp files.
  • Provide a minimal data model and codecs that mirror sleap-io behavior.
  • Enable client-side visualization and analysis pipelines.

Features

  • SLP read/write with format compatibility (including embedded frames via HDF5 video datasets).
  • Streaming-friendly file access (URL, File, FileSystemFileHandle).
  • Core data model (Labels, LabeledFrame, Instance, Skeleton, Video, etc.).
  • Dictionary and numpy codecs for interchange.
  • Demo app for quick inspection.

Quickstart

npm install
npm run build

Load and save SLP

import { loadSlp, saveSlp } from "sleap-io.js";

const labels = await loadSlp("/path/to/session.slp", { openVideos: false });
await saveSlp(labels, "/tmp/session-roundtrip.slp", { embed: false });

Load video

import { loadVideo } from "sleap-io.js";

const video = await loadVideo("/path/to/video.mp4", { openBackend: false });
video.close();

Lite mode (Workers-compatible)

For environments that don't support WebAssembly compilation (e.g., Cloudflare Workers), use the /lite entry point:

import { loadSlpMetadata, validateSlpBuffer } from "@talmolab/sleap-io.js/lite";

// Load metadata without pose coordinates
const metadata = await loadSlpMetadata(buffer);
console.log(metadata.skeletons);     // Full skeleton definitions
console.log(metadata.counts);        // { labeledFrames, instances, points, predictedPoints }
console.log(metadata.provenance);    // { sleap_version, ... }

// Quick validation
validateSlpBuffer(buffer);  // throws on invalid

The lite module uses jsfive (pure JavaScript) instead of h5wasm (WebAssembly), enabling use in restricted environments. It can read all metadata but not pose coordinates or video frames.

Architecture

  • I/O layer: loadSlp/saveSlp wrap the HDF5 reader/writer in src/codecs/slp.
  • Data model: src/model mirrors sleap-io classes and supports numpy/dict codecs.
  • Backends: src/video provides browser media and embedded HDF5 decoding.
  • Streaming: src/codecs/slp/h5.ts selects URL/File/FS handle strategies.

Environments and Streaming

  • Env1 (Static SPA): Browser-only usage with URL streaming (CORS + Range) or the File System Access API.
  • Env2 (Server/Worker): Server-side or worker environments that stream .slp from URLs or byte buffers.
  • Env3 (Local Node/Electron): Optional local filesystem access for Node/Electron.

Streaming can be tuned with:

await loadSlp(url, { h5: { stream: "auto", filenameHint: "session.slp" } });

Demo

The demo in demo/ loads the built package from dist/. Build first, then serve the repo with a static server and open demo/index.html:

npm run build

Release & Publishing

This package uses npm Trusted Publishing. The first publish must be done manually to unlock the npm package settings:

  1. First-time publish (one-time):
npm login
npm publish --access public
  1. Enable Trusted Publisher at https://www.npmjs.com/package/@talmolab/sleap-io.js/access.

After that, GitHub Releases trigger the publish workflow automatically.

Links

  • Python sleap-io: https://github.com/talmolab/sleap-io
  • Docs: https://io.sleap.ai