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

headerkit

v1.0.1

Published

Full-featured command-line client for the HeaderKit browser extension (Agent Mode).

Readme

HeaderKit CLI

HeaderKit 浏览器扩展的功能完整的命令行客户端。它连接运行中的扩展,让你或Agent在终端里创建、读取和修改 HeaderKit 的配置。

安装

npm install -g headerkit
# 或者不安装直接运行:
npx headerkit

使用

  1. 启动 CLI:
headerkit                 # 启动 CLI,等待扩展配对
headerkit --help          # 打印完整命令参考并退出
headerkit --json          # 面向 agent 的机器模式(见下文)
  1. 在 HeaderKit 扩展弹窗中,点击底部工具栏的 Connect CLI 按钮进行配对。在你点击 之前,CLI 会不断提醒你,命令也不会执行;配对成功后 CLI 会打印 ✓ Extension connected.。可以运行 status 查看状态。
  2. headerkit> 提示符后逐行输入命令。

只有 Origin 为浏览器扩展(chrome-extension://moz-extension://)的连接才会被 接受,因此探测你 localhost 的网页无法驱动它。已打包、未打包和开发版构建都无需任何额外 参数即可配对。

命令

profile create [name]                 profile list | get <id>
profile rename <id> <name>            profile color <id> <#hex>
profile enable|disable|delete <id>

rule add <pid> request-header <h> <v> [--action set|append|remove]
rule add <pid> response-header <h> <v> [--action ...]
rule add <pid> cookie <request|response> <name> <v> [--action ...]
rule add <pid> redirect <target> [--regex]
rule set <pid> <rid> field=value ...  # 字段:action|header|value|name|target|enabled
rule enable|disable|remove <pid> <rid>

filter add <pid> <pattern> [--regex] [--exclude]
filter remove <pid> <index>
resource <pid> [--include a,b] [--exclude c,d]

tab set <pid> <tabId> [label]         tab clear <pid>
window set <pid> <winId> <t1,t2,..> [label]   window clear <pid>

pause on|off
export                                # 以多行 JSON 导出全部 Profile
import <json>                         # JSON 必须为单行、无空格

ID(profile-xxxx / rule-xxxx)来自 profile list / profile create / profile get 的输出——先获取它们,再传给后续命令。含空格的值需要加引号: profile create "My Profile"。注意 import 需要单行 JSON,所以 export 的输出不能 直接粘贴回去。

内置命令:tabswindows 列出当前浏览器的标签页 / 窗口(附带你在 tab set / window set 中要用的 id);以及 statushelpexit

Agent / 机器模式(--json

使用 --json 启动可以以编程方式驱动 CLI。此时每行 stdout 都是一个 JSON 对象,且 headerkit> 提示符会被隐藏,因此你可以逐行解析输出流:

  • 命令回复:{"ok":true,"result":...}{"ok":false,"error":"..."}profile create / rule add 会把新 id 放在 result 中;profile list 返回一个 JSON 数组(而不是 ●/○ 文本行);大多数编辑操作返回 result: null
  • 配对状态以事件形式到达: {"event":"listening","paired":false,"message":"Open the HeaderKit extension popup and click \"Connect CLI\" to pair."}, 然后在用户点击 Connect CLI 后变为 {"event":"paired"}unpairedwaiting_for_pairing 事件也会携带同样的可操作 message。在发送命令前请先等待 paired,否则会收到 {"ok":false,"error":"Not paired yet …"}

改动会立即生效:CLI 通过扩展写入 chrome.storage.local,随后会像你在界面里编辑一样 重新协调(reconcile)declarativeNetRequest 规则。

开发

npm install
npm run dev     # 从源码运行
npm run build   # 打包到 dist/index.js

CLI 复用了扩展自身在 ../src/core 中的 Profile 模型和命令语法,因此二者永远不会出现 偏差。