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

eyou-plugin-packer

v3.0.0

Published

易游插件打包工具 — 创建、打包、校验插件(支持内部 JS/TS 与外部 Python/Node 插件)

Readme

eyou-plugin-packer

易游插件开发工具集 — 创建、打包、校验插件。

支持:

  • 内部插件:JS(entry,进程内加载)
  • 外部插件:Python / Node(command,宿主 spawn,脚手架自动内置 SDK,插件自包含)

安装

npm install -D ../plugin-packer

命令

pack-plugin — 打包

npx pack-plugin                        # 打包当前目录(自动识别内部/外部插件)
npx pack-plugin --out ./dist           # 指定输出目录
npx pack-plugin --ui-dir ui            # 内部插件:前端产物放入 zip 的 ui/ 子目录(默认 dist/ → dist/,与 entry=dist/index.html 对齐)

打包规则(zip 根 = manifest.json):

| 插件类型 | 打包内容 | |---|---| | 内部(有 entry,无 command) | manifest.json + entry(默认 index.js;脚手架生成 index.cjs)+ README.md/plugin.d.ts(可选)+ dist/ → dist/(--ui-dir 可改) | | 外部(有 command) | 整个项目目录(自包含:脚本 + SDK + 依赖 + 资源),自动剔除 .git/node_modules/__pycache__/*.pyc 等 |

create-plugin — 脚手架

npx create-plugin                  # 交互式输入,默认输出到当前目录
npx create-plugin --out ../plugins # 指定输出目录

按提示选择语言 js/python/node:

  • js → 内部插件(manifest.json + index.cjs + plugin.d.ts,可带 UI,生成 dist/index.html 模板)
  • python / node → 外部插件(manifest.json + main.py|js + 内置 eyou_sdk.py|js + README.md),打包环境默认显示控制台窗口(hideWindow: false)

编程方式创建(scaffold)

const { scaffold } = require("eyou-plugin-packer/create");

// 外部插件(Python)
scaffold("D:/plugins/my_py", { name: "我的插件", id: "com.eyou.my_py", lang: "python" });
// 外部插件(Node)
scaffold("D:/plugins/my_node", { name: "我的插件", id: "com.eyou.my_node", lang: "node" });
// 内部插件(JS + UI)
scaffold("D:/plugins/my_js", { name: "我的插件", id: "com.eyou.my_js", lang: "js", hasUi: true });

校验(manifest)

pack 打包前会做结构化校验,错误以 ManifestError(含 problems 数组)抛出:

  • 必填:id / name / version
  • id:安全字符集 ^[A-Za-z0-9][A-Za-z0-9._-]{0,127}$,禁止 .. 与路径分隔符(防安装端路径穿越)
  • version:语义化版本号(如 1.0.0)
  • 内部插件:entry 文件必须存在;外部插件:command 非空
  • 描述 ≤ 50 字
  • 读取 manifest.json 时自动去除 UTF-8 BOM 并 trim(兼容记事本/VS Code 保存的带 BOM 文件)

完整 JSON Schema 见 manifest.schema.json。

SDK

templates/python/eyou_sdk.py 与 templates/node/eyou_sdk.js 是 SDK 的唯一维护位置, 脚手架创建外部插件时会复制进插件目录,插件自包含。

与 Vite 集成(内部插件)

"scripts": {
  "build": "vite build && pack-plugin --ui-dir ui"
}

待实现(TODO)

  • 后端上传接口接收外部插件:pack-plugin publish <zip> 上传到市场后端 (plugin-manager-backend)的上传接口,后端存储并在商店展示;需配套发布者鉴权、 版本 / checksum 校验,以及安装时的完整性校验。