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

@mpis/client

v0.0.16

Published

将构建开始、成功或失败的事件发送到构建协议服务器。

Readme

构建协议客户端接口

将构建开始、成功或失败的事件发送到构建协议服务器。

API

import { BuildProtocolClient } from '@mpis/client';

const protocol = BuildProtocolClient();

await protocol.connect().catch((err) => {
	console.error('构建连接失败', err.message);
});

CLI

标准输入模式

build-protocol-client --stdin [--start <开始>] --finish <完成> [--success <成功>] [--error <错误>]

  • --start <开始>:可选,匹配行。如果不设置,则完成状态下输出任何内容都认为是开始。flag = iv
  • --finish <完成>:必须,匹配行,匹配到则发送成功或失败事件。flag = iv
  • --error <失败>:匹配全部输出,匹配到则认为失败。flag = imv
  • --success <成功>:匹配全部输出,匹配到则认为成功。flag = imv

全部输出指的是: 从开始(不含)直到本次完成(包含)的输出内容。如果没有 --start,则“开始”是从上次完成(不含)。

--error--success 至少要设置一个

同时匹配或同时没有匹配到 --error--success 时,优先认定为发生了错误。
但如果输入被关闭(例如前面的进程结束),则在没有匹配到 --error 时候认定为成功。且即使没有匹配到 --finish,也会发送完成事件。

所有字符串都是正则表达式,带有flag=umi,可以设置对应的 --xxx-fixed yyyy ,只进行字符串搜索。

例如:

tsc -p . -w | \
build-protocol-client --stdin \
	--success "Found 0 errors" \
	--finish "Watching for file changes\\." \
	--start "Starting (incremental)? compilation"
运行命令并同时监听stdout和stderr

build-protocol-client [--start <开始>] --finish <完成> [--success <成功>] [--error <错误>] -- <命令> [<参数>...]

  • -- 必须存在,后面的内容会被认定为命令和参数。
  • 其他选项见上方说明