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

koishi-plugin-jmcomic-pdf

v0.0.8

Published

Koishi plugin for generating and sending JM comic PDFs.

Readme

koishi-plugin-jmcomic-pdf

npm

本项目包含两个核心部分:

  1. jm_img-to-pdf:一个后端服务,用于从 JMComic 下载图片并生成 PDF 文件。
  2. koishi-plugin-jmcomic-pdf:一个基于 Koishi 框架的插件,用于通过与 jm_img-to-pdf 服务交互,获取并发送 JMComic 的 PDF 文件给用户。

您当前正在浏览:koishi-plugin-jmcomic-pdf

点此前往 jm_img-to-pdf

项目概述

koishi-plugin-jmcomic-pdf 是一个 Koishi 插件,用于通过 jm_img-to-pdf 服务获取 JMComic 的 PDF 文件并发送给用户。

项目结构

jmcomic-pdf     
├─ src          
│  ├─ temp      
│  └─ index.ts  
├─ package.json 
├─ readme.md    
└─ tsconfig.json

关键文件

  • index.ts:插件核心代码,定义了命令和与 jm_img-to-pdf 服务的交互逻辑。
  • package.json:插件元数据,包括依赖项和 Koishi 配置。

插件配置

通过 Config 对象可以自定义以下选项:

export const Config: Schema<Config> = Schema.object({
  apiUrl: Schema.string().default('http://localhost:3502/download').description('后端 API 地址'),
  timeout: Schema.number().default(30000).description('请求超时时间(毫秒)'),
})
  • apiUrl:指定 jm_img-to-pdf 服务的 API 地址(默认 http://localhost:3502/download)。
  • timeout:设置请求超时时间(默认 30000 毫秒)。

插件功能

  • 注册命令 jm <id>,用于下载并发送指定 ID 的 JMComic PDF 文件。
  • 通过 ctx.http.post 向后端 API 发送请求,获取 PDF 文件的下载地址。
  • 下载 PDF 文件并发送给用户。

运行方式

  1. 确保 jm_img-to-pdf 服务已启动并正常运行。
  2. 安装 Koishi 框架和插件依赖:
    npm install koishi-plugin-jmcomic-pdf
  3. 在 Koishi 项目中启用插件:
    import { App } from 'koishi'
    import jmcomicPdf from 'koishi-plugin-jmcomic-pdf'
    
    const app = new App()
    app.plugin(jmcomicPdf)
    app.start()

3. 项目关联关系

功能流程

  1. 用户在 Koishi 聊天机器人中发送命令 jm <id>
  2. koishi-plugin-jmcomic-pdf 插件将 ID 发送到 jm_img-to-pdf 服务的 /download API。
  3. jm_img-to-pdf 服务下载指定 ID 的 JMComic 图片并生成 PDF 文件。
  4. jm_img-to-pdf 服务返回 PDF 文件的下载链接。
  5. koishi-plugin-jmcomic-pdf 插件下载 PDF 文件并发送给用户。

配置关系

  • koishi-plugin-jmcomic-pdfapiUrl 必须与 jm_img-to-pdfweb_config.yml 中的 server.hostserver.port 一致。
  • 如果 jm_img-to-pdf 服务的域名或端口发生更改,需要同步修改 koishi-plugin-jmcomic-pdfapiUrl

4. 配置修改示例

修改 jm_img-to-pdf 配置

  1. 修改 web_config.yml 中的 port
    server:
      port: 8080
  2. 修改 config.yml 中的图片保存路径:
    dir_rule:
      base_dir: /var/www/jmcomic/img/

修改 koishi-plugin-jmcomic-pdf 配置

  1. 修改 apiUrl 以匹配 jm_img-to-pdf 的新配置:
    apiUrl: 'http://localhost:8080/download'

5. 注意事项

  1. 确保 jm_img-to-pdf 服务正常运行,且防火墙允许相关端口访问。
  2. 如果 jm_img-to-pdf 服务部署在远程服务器上,需修改 apiUrl 为远程地址(如 http://your-server-ip:3502/download)。
  3. 根据需要调整 jm_img-to-pdf 的线程数和缓存设置以优化性能。

通过以上配置和说明,您可以轻松使用 koishi-plugin-jmcomic-pdfjm_img-to-pdf 下载并发送 JMComic 的 PDF 文件。