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

@liu_jimmy/fe-kit-cli

v1.0.4

Published

fe-kit CLI: ai stats, ai record. Track cache hits and token usage.

Downloads

337

Readme

@liu_jimmy/fe-kit-cli

CLI:ai stats 查看缓存与 token 统计,ai record 在每次请求后追加一条数据。

安装

pnpm add -D @liu_jimmy/fe-kit-cli
# 或全局
pnpm add -g @liu_jimmy/fe-kit-cli

命令

ai stats

输出示例:

AI Cache Stats
--------------
Requests:    128
Cache hits:  92
Hit rate:    71.8%

Tokens used:  24,300
Tokens saved: 78,200

Cost saved: $0.39

数据来自 ~/.fe-kit/stats.json(可通过环境变量 FE_KIT_STATS_DIR 指定目录)。

ai record

每次 Cursor / AI 请求完成后执行一次,用于更新统计。

# 一次未命中缓存的请求,消耗了 800 tokens
ai record --request --tokens-used 800

# 一次命中缓存的请求,相当于节省了 1200 tokens
ai record --request --cache-hit --tokens-saved 1200

简写:-r = --request-c = --cache-hit

在 Cursor 里接上「请求完成后记录」(推荐方式 B)

  • 方式 B(推荐):用 create-fe-kit 生成的项目已自带规则:AI 会在回复末尾提示你执行一次 ai record ...(命中缓存则带 --cache-hit --tokens-saved <估算>,否则 --tokens-used <估算>),你复制到终端执行即可。

  • 手动:也可在需要时自己执行 ai record --request --cache-hit --tokens-saved 1200ai record --request --tokens-used 500

  • 程序内记录:若在脚本里调用 compileWithCache,可同时调用:

    import { recordStats } from "@liu_jimmy/fe-kit-cli";
    const result = compileWithCache(spec, "vue", cache);
    recordStats({
      request: true,
      cacheHit: result.fromCache,
      tokensUsed: result.fromCache ? 0 : 500,
      tokensSaved: result.fromCache ? 500 : 0,
    });

Cost saved 仅作记录参考,按每百万 tokens 粗算;可选环境变量 FE_KIT_COST_PER_MILLION 调整单价。