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 🙏

© 2025 – Pkg Stats / Ryan Hefner

koishi-plugin-mcmod

v0.1.1

Published

Koishi plugin: search mcmod.cn and return mod info

Readme

koishi-plugin-mcmod

Koishi 插件:在 mcmod.cn 上搜索模组并返回结果(支持分页与图片预览)。

安装:

  1. 将本插件文件夹放入 Koishi 项目的 external 目录,例如:
C:\Users\25463\Desktop\friend\koishi\external\koishi-plugin-mcmod
  1. 在 Koishi 项目中安装依赖(进入 Koishi 项目根目录):
npm install node-fetch cheerio @napi-rs/canvas
  1. 在 Koishi 启动脚本中加载插件:
const { App } = require('koishi')
const app = new App({ /* your config */ })
app.plugin(require('./external/koishi-plugin-mcmod'))
app.start()

命令:

  • mcmod <关键词> - 搜索 mcmod.cn 并返回分页结果。
  • 翻页:发送 n(下一页)或 p(上一页)。
  • 选择:发送序号(例如 3)会先以图片方式发送对应页面或用户卡片,再发送对应链接。

Filter 映射(可通过 -t 选项使用):

  • mod => filter=1(模组)
  • pack => filter=2(整合包)
  • data => filter=3(资料)
  • tutorial => filter=4(教程)
  • author => filter=5(作者)
  • user => filter=6(用户)

注意:

  • 插件使用 @napi-rs/canvas,对 Node.js 20/24 支持更好,通常无需额外系统编译依赖。

配置示例:

// 在 Koishi 启动脚本中加载并传入配置
const plugin = require('./external/koishi-plugin-mcmod')
app.plugin(plugin, {
	debug: true,
	commands: {
		mod: ['模组', 'mod'],
		data: ['资料'],
		user: ['用户']
	}
})

设置 debug: true 会在控制台输出用于诊断的抓取 URL 和页面片段。

  • 如果页面结构改变,解析器可能需要更新选择器。