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-lovemilk-telemetry

v0.0.12

Published

Lovemilk's 遥测插件

Readme

koishi-plugin-lovemilk-telemetry

适用于 Lovemilk 系列插件的遥测插件

npm

特别鸣谢

[!IMPORTANT] CyanChanges 对本项目的 BUG 修复 与 项目编写支持

EULA

  • 使用本插件所提供服务的插件开发者必须向用户告知并在其同意 EULA 的情况下使用本插件所提供的服务

  • 本插件的 EULA 可在 Koishi WebUI/lovemilk-telemetry/EULA 路径下查看

使用方法

  1. 安装本插件

在插件市场中搜索 loremilk-telemetry 并安装 或 使用如下命令进行安装 (以 yarn 包管理器为例)

yarn add koishi-plugin-lovemilk-telemetry
  1. 在所需插件依赖本插件所提供的 loremilkTelemetry 服务

export const inject = [..., 'loremilkTelemetry']
  1. 合并类型

import {  } from 'koishi-plugin-lovemilk-telemetry'
  1. apply 中注册 endpoint

export async function apply(ctx: Context, config: Config) {s
    ...

    // config 也可以填写 ctx.config, 仅用于上报, 不做处理
    // telemetryEndpoint 是 string 地址或者是 URL 对象, 如 `wss://api.lovemilk.top:5150/api/plugin/${name}/${version ?? 'null'}/telemetry`
    // 其中 `${name}` 是插件名, `${version}` 是插件版本 (来着 `package.json`)
    // 返回 Client 对象
    const telemetryClient = ctx.lovemilkTelemetry.createClient(ctx, config, telemetryEndpoint)

    ...
}

[!IMPORTANT] 如果插件配置中含有隐私信息, 配置项名称请以 _ 开头 (例如 _githubToken), 以 _ 开头的字段将在上报中被忽略

  1. 调用 telemetryClient.connect 函数建立 WebSocket 长链接

telemetryClient.connect()
  1. 调用 telemetryClient.send 函数发送数据

// in apply function

// name 是事件名称, 可以在 telemetry/types.ts 中查看
// data 是数据, 可以在 telemetry/types.ts 中查看
// ignoreResp? 是一个可选参数, 如果为 true, 则不等待服务端响应
// 返回 ServerResponse 或者 undefined
await telemetryClient.send(name, data, ignoreResp?))

[!NOTE] 本插件所提供的服务会自动处理插件注册的命令, 并上报, 无需手动发送 但是, 自动处理与开发环境的 hmr 不兼容, 重载插件请至 WebUI 手动重载或直接重启 Koishi BP 在开发环境下, 服务会每三秒自动重连, 而生产环境会遵循更复杂更适合的规则自动重连