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

stremio-rewired

v0.2.1

Published

> [!WARNING] > This SDK is still a work-in-progress, and as such it may include bugs, especially in features that I don't personally use often. If you encounter bugs feel free to open an issue.

Readme

stremio-rewired

[!WARNING]
This SDK is still a work-in-progress, and as such it may include bugs, especially in features that I don't personally use often. If you encounter bugs feel free to open an issue.

This project is a remake of the stremio-addon-sdk using modern Typescript features. The features provided over the original SDK are:

  • Fetch-based handler: Allows addons to be served in serverless environments (Vercel, Netlify, Cloudflare Workers) and to serve them alongside existing fetch-compatible backend frameworks (Hono, Nitro, Elysia).
  • Improved DX and type-safety: This SDK makes use of Typescript types were possible to further improve DX and ensure addons conform to the Stremio addon protocol.
  • ESM-first: The SDK is written in Typescript using modern ES syntax, making it more future-proof and likely to work with modern setups.

Installation

You can install the package with your package manager:

npm install stremio-rewired

Usage

The SDK exports a createHandler function thats returns a standard Fetch handler, here's an example using Cloudflare Workers:

import { createHandler } from "stremio-rewired";

export default {
  async fetch(request: Request) {
    const handle = createHandler({
      manifest: {
        id: "org.stremio.my-addon",
        version: "0.0.2",
        name: "My Addon",
        description: "This is a cool addon",
        // rest of manifest
      },
      onCatalogRequest(type, id) {
        // handle catalog request

        return {
          metas: [
            /* ... */
          ],
        };
      },
      onStreamRequest(type, id) {
        // handle stream request

        return {
          streams: [
            /* ... */
          ],
        };
      },
    });

    const response = await handle(request);

    if (!response) {
      return new Response("Not found", { status: 404 });
    }

    return response;
  },
};

For more details on what each handler should return see the official SDK's protocol specification.

Launching your extension locally

Similar to the official SDK, this package also allows you to open a web version of Stremio with your addon pre-installed.

You can either do via CLI with:

npx stremio-rewired launch

Which by default will expect the addon to be on the port 3000, you can specify the port like so;

npx stremio-rewired launch -p 1337

The typical workflow locally is to launch the extension along with your dev server in your package.json. So you'd have something like this:

{
  "scripts": {
    "dev": "your-dev-script",
    "dev:addon": "stremio-rewired && npm run dev"
  }
}

Launching Stremio programmatically

You can also import the launch function and run it anywhere you want instead of using the CLI. This will open your default browser on Stremio with your addon installed.

import { launch } from "stremio-rewired/launch";

if (process.env.NODE_ENV === "development") {
  // Launch takes in a port, which should
  // be the same as your dev server port.
  launch(3000);
}

Goodies

Custom manifest fields

You can extend the Manifest object by providing a generic to createHandler:

const handler = createHandler<{
  myCustomField: string;
}>({
  manifest: {
    id: "org.stremio.my-addon",
    version: "0.0.2",
    name: "My Addon",
    description: "This is a cool addon",
    // rest of manifest
    myCustomField: "test",
  },
});

This is useful for integrating with third-party services that require custom fields in the manifest:

const handler = createHandler<{
  stremioAddonsConfig: {
    issuer: string;
    signature: string;
  };
}>({
  manifest: {
    id: "org.stremio.my-addon",
    version: "0.0.2",
    name: "My Addon",
    description: "This is a cool addon",
    stremioAddonsConfig: {
      issuer: "https://stremio-addons.net",
      signature: "some-signature",
    },
  },
});