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

dsh-whale-post-cli

v0.6.1

Published

零依赖命令行:hello/send/pump/quota/verify/nag/roster/types/selftest · Zero-dependency CLI: hello / send / pump / quota / verify / nag / roster / types / selftest

Readme

dsh-whale-post-cli

English: cli README in English

零依赖命令行(它是入口工具,不是插件)

  • 提供接口:(无:它是命令行,不是插件)
  • 依赖接口:whale.bus、whale.roster、whale.types、whale.gate、whale.deliver、whale.verify (自己把它们拼起来 —— 这一手在源码里叫 wire())
  • 自测:node selftest.mjs(只看退出码:0 过/非 0 不过)

命令

| 命令 | 干什么 | |---|---| | hello --as <谁> | 握手(协议不许"像 UDP 那样"直接发 ⇒ 没握过手不许发信) | | send --as <谁> --to <谁\|组> --subject <题> --body <正文> | 发一封;可选 --mode online\|offline/--type <类型>/--re <父信 id>/--force/--live a,b | | pump --as <谁> [--keep] | 收信(没有读者时一封都不消费) | | pickup --as <谁> --remote <别处的信箱根> | 去别的信箱根把自己的信取回来(离线也能用 —— "离 3 在 1"里铃响过之后就是这一步):每封先验签(不过的不搬)⇒ 写进本地 ⇒ 写成功之后才删远端(否则就是丢信)⇒ 已在 seen/已有的跳过(幂等) | | quota --as <谁> [--days N] | 查配额(离线件按"条"、不计单位) | | reconcile --as <谁> [--days N] [--remote <根>] | 对账:从文件系统重算一份账,跟台账逐日逐桶比 —— 一致 ⇒ 退出 0;有差 ⇒ 退出 3。⚠️ forced/over/feeCent/byPhone/recent 重算不出来(文件里没有那些事实),命令会照实列一行"没比的项";投到远端的信不在本机 ⇒ 默认只算本机根,要连远端就带 --remote | | verify [--enable\|--disable] [--allow a,b] | 看安全校验状态/开关(默认禁用;禁用中会提示开启) | | nag | 看该不该提示(未开启时每天至多一次,连提三天后不再提) | | roster/types/key | 看名单/看类型/看密钥指纹(密钥本体不打印) | | selftest | 端到端自测(临时目录,不碰真数据) |

通用参数与退出码

  • --root <目录>:信箱根(默认 ./.whale-mail,或环境变量 WHALE_POST_ROOT)
  • --roster <名单 json>:名单文件
  • --live a,b:声明"这些人此刻有活体会话"(在线件才会真投出去)
  • --remote <目录>:pickup 的远端信箱根(也可用环境变量 WHALE_POST_REMOTE_ROOT)
  • send --remote <邮筒根> --remote-only <属性名>:把信投到远端(S6 的投那半边): 带 <属性名> 的成员(比如手机)⇒ 写远端 inbox/<它>/,本机不留第二份。 为什么本机不能留:留了就有两份权威(而两份会在"取件/回执/消费"上各说各话)。 不配 --remote-only ⇒ 照旧写本机(不改旧行为)。
  • pickup 会把邮筒上的回执镜像回来(S6b):以前只镜像 hello/ ⇒ 发信人的本机永远看不到"对方已经收了"。 两条纪律:只镜不删(邮筒那份原样留着)/幂等(内容相同就跳过 ⇒ 不动 mtime)。
  • pickup 动"邮筒"之前先探活(S12 断线不卡死):只看 TCP 445 通不通 → 本机路径不探; 够不着就当场判死("一个文件都没动")。为什么必须这样:SMB 掉线时同步 fs 会挂住几十秒 ,而Node 的同步 fs 自己没有超时 ⇒ 只能靠「子进程 + timeout」拿到上限。 实测:够不着的 UNC ⇒ 2.8 秒判死;把探活短路掉再跑 ⇒ 22.7 秒才失败(这就是它挡下的东西)。
  • --only-offline <属性名>:带此属性的成员只收离线(对它发在线 ⇒ 拒发)
  • --dormant <属性名>:带此属性的成员被明确标成休眠(发信 ⇒ 当场拒发、不合信箱;部分休眠会打出来"没投给谁")
  • --allow a,b:安全校验的白名单

| 退出码 | 意思 | |---|---| | 0 | 成功 | | 2 | 拒发/输入不合法(配额/回环闸/未注册类型/未知收件人/空正文/mode 写错…) | | 1 | 没料到的错 |

判据看退出码,不要看输出里的中文。

它守的两条线

  • --body 不许冒充参数 —— --body --force 会被当成"正文=--force 且带 force" ⇒ 顺手把三道闸全绕过去; 选项值以 -- 开头一律当写错(退出码 2)。
  • 参数顺序无关 —— --as/--to 写在命令前后都行。
  • npm 上最新已经是 0.6.1(下面这行 npx 装的就是它);而本仓库也是 0.6.1 —— 两边已经一致。
  • 用 npm 上那一份:npx -y [email protected] <命令>(不用 clone、不用 npm install)。