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/run

v0.0.19

Published

简单地按顺序执行一系列外部命令,最终完成项目的构建过程

Readme

究极简单的分步构建器

简单地按顺序执行一系列外部命令,最终完成项目的构建过程

为实现watch,所有命令需要支持 构建协议

对于不支持的命令,可以使用 标准输出监视器 或 客户端API 快速实现

Path中添加当前包rig包node_modules/.bin目录

配置: 创建文件config/commands.json,内容如下:

{
	/**
	 * 示例文件
	 * 
	 * 文件里可以写注释
	 */
	"$schema": "../node_modules/@mpis/run/commands.schema.json",
	"build": [
		{
			// 也可以写成字符串,但强烈不建议,无法正确处理空格和特殊字符,且额外增加一层shell
			"command": ["codegen", "src"]
		},
		{
			"title": "autoindex",
			"command": {
				// 运行指定包里的指定bin,不会自动安装此包,它必须存在于当前包或rig包的依赖中,此binary必须是js文件
				"package": "@build-script/autoindex",
				// 要执行的bin名字,必须设置。但如果此包的bin字段是字符串,则必须不设置。
				"binary": "autoindex",
				"arguments": ["src"]
			}
		},
		// 可以从 commands 中引用
		"some-common-command",
		{
			// 可选,默认为command的第一个单词,仅用于显示
			"title": "typescript",
			"command": ["mpis-tsc", "-p", "src"],
			// 可选,当调用watch时默认添加 -w 可以换成其他参数代替 -w
			"watch": ["--watch" ]
		},
		{
			"title": "esbuild",
			// 当command第一个元素是 xxx.ts,可以直接执行它,此文件相对于package.json所在路径,同时也会在rig/profile和rig根目录中寻找同名文件
			"command": ["scripts/esbuild.config.ts"],
			// 此命令的工作目录,相对于package.json所在目录
			"cwd": "."
		},
		{
			"title": "esbuild",
			"command": [
				"build-protocol-client",
				"--start=Starting compilation",
				"--finish=Finished compilation",
				"--success=Successfully .*",
				"--error=Failed to .*",
				"--",
				"some-other-command",
				"--some-arg=some-value",
			]
		},
	],
	"commands": {
		  // 可以在此处定义一些常用的命令,供其他命令引用
		"some-common-command": {
			"title": "common command",
			"command": ["some-command", "--arg=value"]
		}
	},
	"clean": [
		"dist",
		"lib",
	]
}

运行

  • 此处的run就是本包安装的bin文件名,如果有冲突,也可以用mpis-run代替
pnpm exec run build
pnpm exec run watch
pnpm exec run clean
{
	"name": "my-project",
	"version": "1.0.0",
	"scripts": {
		"prepack": "mpis-run build --clean",
		"build": "mpis-run build",
		"watch": "mpis-run watch",
		"clean": "mpis-run clean"
	},
}