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

@paperkite/plugin-favorites-cleanup

v0.1.4

Published

Readme

@paperkite/plugin-favorites-cleanup

收藏清理插件,提供 favorites.cleanup 动作能力。扫描当前会话用户收藏(Saved Messages)里转发的文件,探测已失效(文件源被删除或引用过期、无法再下载)的消息并删除。

commands:
  - id: favorites-cleanup
    title: 清理失效的转发文件
    run:
      capability: favorites.cleanup
      session: primary
      config:
        maxMessages: 1000

动作仅处理收藏中带转发来源(fwdFrom)的图片与文件消息;探测时只下载首块数据即确认文件可用,不会拉取完整文件。同一条相册消息(分组)中任一成员失效时,会连同整组一起删除。

配置

| 键 | 说明 | | --- | --- | | maxMessages | 从最新开始扫描的收藏消息条数上限;默认 500,0 表示不限 | | dryRun | 只统计并记录将删除的消息,不实际删除;默认 false |

失效判定

两类转发会被判定为失效:

  1. 带图片/文件的转发:发起媒体下载探测,数据开始返回视为有效;返回 FILE_REFERENCE_EXPIRED、FILE_REFERENCES_EMPTY、MEDIA_EMPTY 等引用过期错误视为失效。探测只取首块数据即中断,不会拉取完整文件。
  2. 来源频道已不可访问的转发:源频道被封禁后,Telegram 会剥离媒体,仅留下以 "This channel can't be displayed…" 开头的占位文案;此类转发直接判定失效。

网络等非引用类失败不会删除任何消息,仅记录告警后跳过。结束时输出 scanned、forwarded、valid、expired、unavailable、failed、deleted 等统计。