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-pointmintmarket

v0.1.5

Published

积分商城系统 - 为其他插件提供商品注册和购买功能

Readme

积分商城插件 (pointmintmarket)

npm

积分商城系统 - 为其他插件提供商品注册和购买功能,降低开发者的开发难度和提高用户的易用性。

功能特点

  • 统一的商品注册和管理接口
  • 完整的商品购买流程(开发中)
  • 灵活的商品分类和标签系统(开发中)
  • 库存管理功能
  • 购买记录追踪(开发中)
  • 良好的用户交互界面

插件界面

image

使用方法

安装与配置

  1. 使用商城安装依赖插件:koishi-plugin-pointmint
  2. 安装本插件
  3. 依照你的需求安装你所需要的插件,例如:
  1. 启用这些插件,在侧边栏的积分商城管理中配置商品的信息
  2. ~~看我干啥,用啊~~

用户命令

  • 商城 - 查看商城商品列表
  • 兑换 <商品id> - 兑换指定商品

开发者接入

这是一个基本的接入示例:

import { Context } from 'koishi'

export const inject = ['market']

export function apply(ctx: Context) {
  ctx.market.registerItem('your-plugin-name', {
    name: '测试商品',
    description: '这是一个测试商品',
    tags: ['测试', '示例'],
    onPurchase: async (session) => {
      // 处理购买逻辑
      await session.send(`用户 ${username} 购买了测试商品`)
      return true // 返回购买处理结果
    }
  })
}

如上面展示的那样market.registerItem 方法用于注册商品,需要你填入以下参数:

  • name - 商品名称
  • description - 商品描述
  • tags - 商品标签
  • onPurchase - 购买回调函数,用于处理购买逻辑。

关于onPurchas

值得注意的是,onPurchase函数需要一个返回值。你可以简单的返回true/false来表示购买是否成功,就像上面示例中展示的那样。你也可以返回一个字符串,给用户展示购买失败的原因,商城将为你展示给用户。例如:

onPurchase: async (session) => {
  return '网络异常' // 返回购买处理结果
}

你还可以返回一个包含codemsg的对象,用于详细展示。如:

onPurchase: async (session) => {
  return {
    code: 1,
    msg: '库存不足'
  } // 返回购买处理结果
}

版本日志

v0.1.4

  • 修复:商城指令报错问题

v0.1.3

  • 新增:商城icon