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

@catargo/lyra

v0.6.2-velover.5

Published

Lyra (paradoxum-games/lyra) for roblox-ts: session-locked player data with transactions, validation, migrations and sharding. Install it under its roblox-ts name: bun add @rbxts/lyra@npm:@catargo/lyra

Readme

@catargo/lyra

Lyra for roblox-ts: safe player data with session locking, validation, migrations, automatic sharding and multi-key transactions.

This is a fork of 6ixfalls/rbxts-lyra, the roblox-ts build of paradoxum-games' Luau library. The library stays Luau (src/*.luau) with hand-written typings (src/*.d.ts), so upstream fixes merge cleanly. Everything around it is a roblox-ts project: bun, TypeScript 7, and tests in TypeScript that run in Roblox Studio.

Early development. Upstream: "While Lyra has been tested and is used in production, it's still in early development. Some features, like transactions, have not yet been battle-tested in production at scale. Avoid using Lyra in production games where data loss would be catastrophic until it has been tested more thoroughly."

Install

On npm as @catargo/lyra. Install it under its roblox-ts name, so that it lands in node_modules/@rbxts/lyra:

bun add @rbxts/lyra@npm:@catargo/lyra

It expects the standard roblox-ts Rojo layout (node_modules/@rbxts mapped under ReplicatedStorage.rbxts_include.node_modules): the Luau requires @rbxts/t beside it and the roblox-ts runtime Promise in rbxts_include by string path.

Quick start

import { createPlayerStore } from "@rbxts/lyra"; // named exports only
import { Players } from "@rbxts/services";
import { t } from "@rbxts/t";

const store = createPlayerStore({
	name: "PlayerData",
	template: { coins: 0, inventory: [] as string[] },
	schema: t.strictInterface({ coins: t.number, inventory: t.array(t.string) }),
	freezeData: false, // keep your tables writable (see below)
	studioIgnoresLocks: false, // a Studio playtest must not steal live players' locks
});

Players.PlayerAdded.Connect((player) => {
	store.load(player).catch(warn); // Lyra kicks the player itself if the load fails
});
Players.PlayerRemoving.Connect((player) => {
	store.unload(player).catch(warn);
});
game.BindToClose(() => store.closeAsync()); // Lyra doesn't bind it for you

// Copy-on-write update: return new data, or false to abort.
store.updateImmutable(player, (data) => ({ ...data, coins: data.coins + 100 }));

// Atomic across players: both change, or neither does.
store.txImmutable([giver, receiver], (state) => {
	const from = state.get(giver)!;
	const to = state.get(receiver)!;
	if (from.coins < 50) return false;
	return new Map([
		[giver, { ...from, coins: from.coins - 50 }],
		[receiver, { ...to, coins: to.coins + 50 }],
	]);
});

The full guide, with the gotchas (locks and kicks, freezing, JSON-safe data, transaction costs), is the skill in skills/lyra/SKILL.md, which ships in the package as a Claude Code plugin (below). Upstream's guides are in docs/ (written for Luau; the TypeScript names are the same).

What this fork changes

All in CHANGELOG.md. In short:

  • freezeData (default true): false stops Lyra deep freezing your data and the tables you hand it.
  • Configurable timings: lockDuration (90 s), lockRefreshInterval (two thirds of it, at most 60 s) and autosaveInterval (300 s).
  • studioIgnoresLocks (default true, as upstream): false stops a Studio server from taking locks that live servers hold.
  • A cheaper "did anything change" check after each update (shared subtables are skipped).
  • String requires throughout; @rbxts/t as a range, so it dedupes with yours.
  • Typing fixes: PlayerStore.createPlayerStore, unload/unloadAsync return nothing.

The skill for Claude Code

The package carries a Claude Code plugin with the lyra skill. To use it in a project, add to the project's .claude/settings.json, with the absolute path of the project's installed package:

{
	"extraKnownMarketplaces": {
		"catargo-lyra": {
			"source": { "source": "directory", "path": "C:/path/to/project/node_modules/@rbxts/lyra" }
		}
	},
	"enabledPlugins": { "lyra@catargo-lyra": true }
}
  • Use an absolute path: Claude Code records a directory marketplace by name, user-wide, at the path it first resolved, so a relative path would stay pinned to the first folder that registered it.
  • It loads from node_modules in place: a package update reaches it at the next session, or after /reload-plugins. The skill is /lyra:lyra; only its description is in context until it is used.

Development

src/           the package: Lyra's Luau + its .d.ts typings (all that ships)
docs/          upstream's guides, as plain Markdown
test-place/    a Flamework v2 place (rbxts-rs flamework-template) with the tests, in TypeScript
scripts/       typecheck.mjs
skills/        the lyra skill (how to use the package), shipped as a Claude Code plugin
.claude-plugin/ its plugin.json and marketplace.json
bun install
bun run typecheck   # src/*.d.ts with TypeScript 7
bun run test        # the tests, in Roblox Studio (see test-place/README.md)
bun run test --cloud --run-timeout 300s   # in a real server, on real DataStores (needs the key)
bun run format      # StyLua on src/ (rokit install for StyLua)
  • Keep .luau changes small and list each in CHANGELOG.md, so upstream merges stay easy. Keep the .d.ts files in step with the Luau.
  • A change to Lyra comes with a test in test-place/src/server/tests/.
  • Release: bump version in package.json, add a CHANGELOG.md entry, commit, tag v<version>, check npm pack --dry-run ships nothing private, then npm publish --tag latest --otp <code> (npm wants a tag for prerelease versions).

Credits

Lyra by paradoxum-games (nomer888, outofbears and contributors). roblox-ts packaging by 6ixfalls. MIT.