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

@xlibrary/plugin-sdk

v2.2.1

Published

Typed contracts and test tools for XLibrary plugins.

Readme

XLibrary Plugin SDK

Templates, a CLI, typed contracts and deterministic test tools for XLibrary .xlplugin packages.

Create a plugin

npx @xlibrary/plugin-sdk create my-plugin --template game-source
cd my-plugin
npm install
npm test
npm run check
npm run package

The JavaScript templates have no build step: the plugin is runtime/index.js, loaded by XLibrary as it is. Node.js 20+ is needed only for the tests and the CLI. Install the resulting dist/<id>-<version>.xlplugin in XLibrary → Plugins.

| Template | What it adds | | --- | --- | | game-source | A provider in "+ Add game": search a site over HTTPS, add a game | | download-source | A download source: torrents for a game with a tracker sign-in | | game-action | Game page buttons that change tags and status, and a sidebar panel | | widget | A panel with library numbers on the Library page | | starter | The TypeScript starter with a local preview (pnpm build first) |

Working with an AI agent? XLibrary 3.11+ is an MCP server: turn on Plugin development in AI Agents and ask the agent to create a plugin. See docs/agent-workflow.md.

CLI

xlibrary-plugin create [directory] [--template name] [--id id] [--name text] [--author text] [--install]
xlibrary-plugin check [directory] [--json]
xlibrary-plugin pack [directory] [--out file]
xlibrary-plugin preview [directory] [--query text]
  • create copies a template and fills in the id, name, author and SDK version.
  • check validates the manifest with the XLibrary rules, the package contents, and the rules of the XLibrary catalog server, including the script rules that flag a published version. --json prints a machine-readable report.
  • pack runs the same checks, then writes an archive with manifest.json, runtime/, locales/, LICENSE and README.
  • preview runs a game-source plugin through the test host.

Documentation

Start with docs/overview.md. The most used pages:

Live examples: the official plugins rpdl and thread-mirrors.

Test without XLibrary

import {createPluginTestHost, runGameSourceSearch} from '@xlibrary/plugin-sdk/testing';
import plugin from '../runtime/index.js';

const host = createPluginTestHost({
  permissions: ['game-sources.providers', 'network.http'],
  network: ({url}) => ({status: 200, body: btoa(JSON.stringify({results: []}))}),
});
const result = await runGameSourceSearch(plugin, {sourceId: 'catalog', query: 'example', limit: 20}, host);

The test host records calls, controls time, denies host calls without a declared permission, and validates results. Invalid results throw PluginContractValidationError with the exact field path, a stable code, and a hint.

Types

npm install -D @xlibrary/plugin-sdk

In JavaScript, use JSDoc: /** @type {import('@xlibrary/plugin-sdk').XLibraryPlugin} */. In TypeScript, import type {XLibraryPlugin} from '@xlibrary/plugin-sdk'. The SDK is a development dependency only: a packaged plugin never imports it at runtime.