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-database-qa

v1.0.3

Published

一个用于Koishi的数据库QA查询插件,支持简繁转换、模糊查询和正则匹配

Readme

Koishi 查询插件

一个支持自定义查询命令、简繁中文转换、模糊查询和正则匹配的 Koishi 插件。

功能特性

  • 自定义查询命令:支持一个命令对应多个问答对,问答对可在配置文件中动态添加。
  • 简繁中文转换:支持将简体中文转换为繁体中文。
  • 模糊查询:支持模糊匹配查询内容。
  • 正则匹配:支持使用正则表达式进行查询。

安装

  1. 将插件目录复制到 Koishi 的插件目录中。
  2. 安装依赖:
    npm install
  3. 在 Koishi 配置文件中加载插件:
    plugins:
      query-plugin:
        $use: ./koishi-query-plugin

配置

插件的配置文件为 config.yml,示例配置如下:

commands:
  - name: query
    pairs:
      - question: 你好
        answer: 你好,有什么可以帮你的吗?
      - question: 天气
        answer: 今天天气晴朗,适合外出。
  - name: faq
    pairs:
      - question: 如何安装插件
        answer: 请参考官方文档的安装指南。
      - question: 插件支持哪些功能
        answer: 支持自定义查询、简繁转换、模糊匹配和正则匹配。

enableTraditionalChinese: false
enableFuzzyMatch: true
enableRegex: false

配置项说明

  • commands:定义查询命令及其问答对。
    • name:命令名称。
    • pairs:问答对列表,每个问答对包含 questionanswer
  • enableTraditionalChinese:是否启用繁体中文转换(默认:false)。
  • enableFuzzyMatch:是否启用模糊查询(默认:false)。
  • enableRegex:是否启用正则匹配(默认:false)。

使用示例

  1. 启动 Koishi 并加载插件。
  2. 在聊天窗口中输入配置的命令名称(如 queryfaq)和问题,例如:
    query 你好
    插件将返回对应的答案。

注意事项

  • 确保配置文件中的问答对格式正确。
  • 启用正则匹配时,需确保正则表达式的正确性。