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

@flavor-code/time-plugin

v0.1.1

Published

时间插件

Downloads

328

Readme

time-plugin

flavor-code 插件(apiVersion 1,零依赖):用户输入日期相关内容时,自动把中文口语日期表达转化为公历日期。

例:今天是 2026-08-28(周五),用户输入「下周三」→ 2026-09-02(周三)。

注册的能力

| 类型 | 名称 | 说明 | | --- | --- | --- | | 命令 | /time-plugin <日期表达…> | 手动把中文日期表达转换为公历,返回 ISO 日期、星期与相对天数 | | Hook | UserPromptSubmit | 检测用户提示词中的日期表达,命中后在放行决定中附上 additionalContext(转换结果),供模型直接使用 |

flavor-plugin.json 的 contributes 与 index.js 中 activate 的 register* 一一对应;插件不申请任何权限。

支持的表达

  • 今天/今日/本日、明天/明日/次日、昨天/昨日、前天、后天、大前天、大后天
  • N天后 / N天前(N 支持阿拉伯数字与简单中文数字,如 三天后、十天前)
  • 周X / 星期X / 礼拜X(X 为一~六、日、天);裸「周X」若本周该日已过,按下一周期理解
  • 本周X / 这周X、下周X、下下周X、上周X、上上周X;中间可带「个」(如 下个星期三、这个周末)
  • 单独的 下周 / 上周 等取对应周的周一;周末 取周六

目录结构

flavor-plugin.json   插件清单(严格 schema)
index.js             入口:export function activate(context)
package.json         {"type":"module"}
scripts/check.mjs    离线契约检查:清单结构 + 激活冒烟

检查

node scripts/check.mjs /path/to/time-plugin

契约要点(保留自模板)

  • 只允许相对导入与 node: 内置模块;确需第三方库时在插件目录内 npm install 或 vendor 到 vendor/。
  • activate 保持轻量:同步注册,重活延迟到首次调用。
  • Hook 返回 { decision: "allow" } 之类决定对象,并用 { failurePolicy: "allow" } 避免阻塞代理。
  • 返回的 disposer 在插件卸载时调用,用于释放资源。