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

mugiwara-plugin-source-comix

v0.1.0

Published

Comix source plugin for Mugiwara manga reader - imports manga from comix.to

Readme

Comix Source Plugin for Mugiwara

A built-in source plugin for Mugiwara manga reader that enables importing manga from Comix.

Status

This is an internal built-in plugin that comes pre-installed with Mugiwara. It is not published to NPM and is automatically registered when the server starts.

Features

  • Search: Search for manga by title with pagination
  • Metadata: Automatic fetching of manga metadata including:
    • Title and alternative titles
    • Description
    • Author and artist information
    • Cover image
    • Genres and tags
    • Publication status and type (Manga/Manhwa/Manhua/Webtoon)
  • Chapters: Browse and download all chapters with:
    • Full chapter listing (all pages fetched, pagination handled internally)
    • Deduplication of multi-group duplicate chapter numbers (prefers official scans, then highest votes)
    • Page-by-page streaming download
    • Automatic retry on failures

Configuration

The plugin can be configured via the Mugiwara server configuration:

interface ComixConfig {
  // Base URL for Comix (default: "https://comix.to")
  baseUrl?: string;

  // Request timeout in milliseconds (default: 30000)
  requestTimeout?: number;

  // User agent for requests (default: "Mugiwara/1.0.0")
  userAgent?: string;

  // Number of search results per page (default: 20)
  searchLimit?: number;

  // Number of chapters fetched per chapter-list page (default: 20)
  chapterPageSize?: number;
}

Usage

Since this is a built-in plugin, you don't need to install anything. The source is automatically available with the ID "comix".

API Endpoints

Search for Manga

curl "http://localhost:3000/api/library/sources/comix/search?q=One%20Piece"

Get Manga Details

curl "http://localhost:3000/api/library/sources/comix/manga/{hid}"

Where {hid} is the Comix manga hid (e.g. n8we, returned by search).

Import Manga

curl -X POST "http://localhost:3000/api/library/import" \
  -H "Content-Type: application/json" \
  -d '{
    "sourceId": "comix",
    "sourceMangaId": "n8we",
    "storageBackendId": "default",
    "downloadAll": true
  }'

Programmatic Usage

import createComixSource from "@mugiwara/source-comix";

const source = createComixSource({ config: {} });

await source.initialize({});

const results = await source.search("Solo Leveling");
const manga = await source.getMangaDetails(results[0].sourceMangaId);

for await (const page of source.downloadChapter(
  manga.chapters[0].sourceChapterId,
)) {
  // page.data contains the image buffer
  // page.pageNumber is the page number
  // page.contentType is the MIME type
}

Cloudflare & Crypto

Comix is fronted by Cloudflare but does not present an interactive challenge to plain HTTP fetches. However, the /api/v1/* endpoints enforce an application-layer token: every GET on a signed path must carry a _ token minted from the request's canonical form, and encrypted responses are returned as {"e":"..."} envelopes.

This plugin ships a pure-TS port of the reversed frontend protocol (src/crypto.ts, tables resolved via src/tables.ts):

  • makeCrypto(tables) builds signToken(canonical), which reproduces browser-minted _ tokens byte-identically (three chained S-box/XOR stages with keys k367/k432/k55, seeds 189/133/32), plus decryptEnvelope(e) for encrypted responses.

No headless browser is needed at runtime. The S-boxes/keys are baked into a specific frontend build (tl03m9, asset hash 35595e3de3c99889c1aa70); the client detects the live build hash from already-fetched page HTML and uses the pinned src/tables.json while it matches. On-demand derivation from a fresh secure-*.js bundle is designed but not yet implemented (handoff/02-crypto-spec.md §7, tryDeriveTables contract in src/tables.ts), so if Comix redeploys with rotated tables, signed requests will fail with a ComixTablesStaleError naming both the observed and expected builds — then re-snapshot (runbook: handoff/05-re-tooling.md) and refresh src/tables.json.

Endpoints

  • Search: GET /api/v1/manga?keyword=...&limit=...&page=...&content_rating[]=... (plaintext, signed)
  • Manga details: GET /title/{hid} HTML → embedded initial-data JSON (no token)
  • Chapter list: GET /api/v1/manga/{hid}/chapters?page=...&limit=...&order[number]=desc (encrypted, signed)
  • Chapter pages: GET /api/v1/chapters/{id} (encrypted, signed) → pages.items[].url
  • Page images: direct GET on the per-chapter image host, requires Referer: https://comix.to/ (else 403). Hosts vary per chapter — URLs are always taken verbatim from the API payload, never hardcoded.

Retry Logic

The plugin implements the following retry behavior for page downloads:

  • 100ms delay between page downloads
  • Exponential backoff on retry (1s, 2s, 3s)
  • 30-second timeout on API requests
  • Maximum 3 retries per page

License

MIT

Disclaimer

This plugin is not affiliated with Comix. Please respect their terms of service when using this plugin.