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-auth-cleanup

v0.1.1

Published

定期清理 Koishi 控制台的过期登录记录

Readme

Koishi Auth Cleanup

npm License

让控制台的登录记录不再无限增长

定期清理 Koishi 控制台的过期登录记录。 官方 auth 插件每次登录都会写入一条记录,但不会删除已过期的记录,本插件负责将其定期清理。


✨ 功能

  • 定期清理:按设定的间隔(小时)删除数据库 token 表中已过期的登录记录,默认每天一次。
  • 只删过期记录:仍在有效期内的登录不受影响,不会把任何设备踢下线。
  • 过期后保留:可以让过期记录再保留若干天才删除,方便回看近期登录过的设备和 IP。
  • 启动时清理:插件启动时立即清理一次,可以关闭。

✅ 前置条件

  • Koishi,并启用官方 auth 插件(@koishijs/plugin-auth)和任意数据库插件。

📦 安装

在 Koishi 控制台的插件市场中搜索 auth-cleanup 安装,或在 Koishi 项目目录中运行:

npm install koishi-plugin-auth-cleanup

⚙️ 配置

| 配置项 | 默认值 | 说明 | | --- | --- | --- | | intervalHours | 24 | 清理间隔(小时),最短 1 小时。 | | retentionDays | 0 | 登录记录过期后再保留的天数,0 表示过期即删除。 | | runOnStart | 开启 | 插件启动时立即清理一次。 |

登录记录的有效期由 auth 插件的 authTokenExpire 决定,默认 7 天。

⚠️ 使用声明

  • 删除的登录记录无法恢复。如需保留登录历史,请设置 retentionDays 或先备份数据库。
  • 本插件直接操作 auth 插件的 token 表,若 auth 插件日后修改表结构,可能需要随之更新。

📄 许可

本项目基于 GPL-3.0 开源。

🙏 致谢

  • Koishi:机器人框架,以及本插件所清理的 auth 插件。