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

vite-plugin-pack-orchestrator

v1.0.2

Published

Vite plugin for auto-archiving dist folder to ZIP/TAR/7Z after build

Readme

Vite Plugin Pack Orchestrator

English | 简体中文

一个精简的 Vite 插件:vite build 完成后自动将 dist 打包为 ZIP / TAR / 7Z,同时计算 MD5 / SHA1 / SHA256 校验和,支持自动重命名。

安装

npm install vite-plugin-pack-orchestrator

使用

// vite.config.ts
import orchestrator from 'vite-plugin-pack-orchestrator';

export default {
  plugins: [
    orchestrator({
      pack: {
        outDir: 'dist',                    // 要打包的源目录,默认 'dist'
        fileName: 'app-[version]-[timestamp]', // 支持 [name] [version] [timestamp] [hash]
        format: 'zip',                    // zip | tar | tar.gz | 7z
        compressionLevel: 9,              // 0-9
        exclude: ['**/*.map'],            // 排除的文件
        include: ['**/*.js'],             // 包含的文件(可选)
        archiveOutDir: './output',        // 压缩包输出目录,不写默认项目根目录
      },
      hooks: { ... },
      verbose: true,                      // 开启详细日志
    }),
  ],
};

格式

| 格式 | 说明 | 依赖 | |:----:|------|------| | zip | 标准 ZIP | 无 | | tar / tar.gz | Gzip 压缩 TAR | 无 | | 7z | 高压缩 7-Zip | 无(内置) |

钩子

onAfterBuild 可返回新路径实现重命名,返回值与原路径不同时自动重命名:

// 1. 在扩展名前插入 sha1 哈希
// app.zip → app-3a7b2c1d.zip
onAfterBuild: (path, format, checksums) =>
  path.replace(/(\.(?:zip|tar\.gz|tar|7z))$/, `-${checksums.sha1.slice(0, 8)}$1`);

// 2. 用 MD5 全量替换文件名
// app.zip → a1b2c3d4e5f6a7b8c9d0e1f2a3b4c5d6.zip
onAfterBuild: (path, format, checksums) =>
  path.replace(/^.+(?=\.\w+$)/, checksums.md5);

// 3. 追加格式和哈希到原始文件名
// app.zip → app-zip-3a7b2c1d.zip
onAfterBuild: (path, format, checksums) =>
  path.replace(/(\.\w+)$/, `-${format}-${checksums.sha256.slice(0, 8)}$1`);

// 4. 完全自定义文件名,用 format 参数自动适配后缀
// app.zip → release-a1b2c3d4e5f6.zip
onAfterBuild: (path, format, checksums) =>
  `release-${checksums.md5.slice(0, 12)}.${format}`;

checksums 结构:

{ md5: string; sha1: string; sha256: string }

⚠️ onAfterBuild 返回的路径后缀必须与打包 format 一致(如 zip 格式必须以 .zip 结尾),否则会输出警告。文件仍会重命名,但后缀不匹配可能导致下游解析异常。

License

MIT