Big News: Socket raises $60M Series C at a $1B valuation to secure software supply chains for AI-driven development.Announcement
Sign In

hono-stremio

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

hono-stremio

A third-party Stremio Addon middleware for Hono

latest
Source
npmnpm
Version
0.1.2
Version published
Weekly downloads
13
550%
Maintainers
1
Weekly downloads
 
Created
Source

hono-stremio

[!CAUTION] DEPRECATED: This package is no longer maintained. Please use the Stremio Community Addon SDK instead, which provides better support, active maintenance, and improved features.

Easily build Stremio addons using Hono. Write your code once and deploy it to any platform supported by Hono, such as Cloudflare, Fastly, Deno, Bun, AWS, and more.

This package is compatible with the stremio-addon-sdk interface, thus requiring zero to minimal changes to integrate your existing Stremio addon.

:zap: Quickstart

  • Create a new Hono project (if you haven't already) and install the package:
$ npm create hono@latest my-app
$ npm i hono-stremio
  • Get the addon interface:

ESM:

// addon.js
import addonBuilder from 'stremio-addon-sdk/src/builder'
import landingTemplate from 'stremio-addon-sdk/src/landingTemplate'

const builder = new addonBuilder({
  // ...
})

builder.defineStreamHandler(function (args) {
  // ...
})

const addonInterface = builder.getInterface() /// <--- get the interface
const landingHTML = landingTemplate(addonInterface.manifest) // (optional) Generate landing page HTML. You can also provide your own HTML if you prefer.

CJS:

// addon.js
const addonBuilder = require('stremio-addon-sdk/src/builder')
const landingTemplate = require('stremio-addon-sdk/src/landingTemplate')

const builder = new addonBuilder({
  // ...
})

builder.defineStreamHandler(function (args) {
  // ...
})

const addonInterface = builder.getInterface() /// <--- get the interface
const landingHTML = landingTemplate(addonInterface.manifest) // (optional) Generate landing page HTML. You can also provide your own HTML if you prefer.

[!NOTE]
The addon builder MUST be imported by its full relative path stremio-addon-sdk/src/builder, as shown above. This is required to ensure compatibility with all of Hono's supported platforms. See the FAQ below for more information.

  • Connect the stremio router to your Hono app:
// index.ts
import { Hono } from 'hono'
import { getRouter } from 'hono-stremio'

// ...

const addonRouter = getRouter(addonInterface, { landingHTML })

const app = new Hono()

app.route('/', addonRouter)

export default app

That's it! You can now deploy your Stremio addon to any platform supported by Hono. Follow the Hono documentation to learn more.

:question: FAQ

Why do I need to import the addon builder by its full relative path?

The Stremio Addon SDK still uses the old module.exports and require syntax (i.e. CJS) which is not natively supported by all Hono platforms. The main issue here is that most (if not all) platforms are already using the new ES Module standard (ESM) by default. While CJS modules can be imported from ESM, there's no named exports but only a default-exported object. Thus, when importing from the package entrypoint (index.js) you are importing all of the code contained in the package including Node-specific code that will not work on other platforms.

By importing the addon builder by its full relative path, you are basically hand-picking the necessary module from the package, without the additional clutter from the entrypoint. This is a temporary workaround until the Stremio Addon SDK is updated to use ESM.

If you have any suggestions or ideas on how to improve this, please open an issue to discuss! I would love to hear your thoughts.

FAQs

Package last updated on 31 Oct 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts