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

@vvb/frontend-deploy

v0.3.1

Published

前端构建产物一键部署工具

Downloads

12

Readme

@vvb/frontend-deploy

一个用于 前端构建产物自动部署 的命令行工具(CLI)。

适用于本地开发与 CI/CD 场景,可在构建完成后,将指定目录打包并上传到部署接口。


Installation

推荐作为开发依赖安装:

npm install @vvb/frontend-deploy --save-dev


Usage

1. 配置 npm scripts

在前端项目的 package.json 中添加:

{ "scripts": { "build_test": "vue-cli-service build --mode test", "deploy": "frontend-deploy", "build:deploy": "npm run build_test && npm run deploy" } }

也可以使用--env参数使用环境配置(需要使用0.3.0版本):

{ "scripts": { "build_test": "vue-cli-service build --mode test", "deploy": "frontend-deploy --env test", "build:deploy": "npm run build_test && npm run deploy" } }

执行构建并部署:

npm run build:deploy


2. 配置部署环境变量

在项目根目录创建文件:

.env.deploy

示例内容:

DEPLOY_URL=https://api.example.com/deploy-api/deploy/file DEPLOY_FILE=dist DEPLOY_TOKEN=your-token-here(选填) DEPLOY_META={"param-1":"1","params-2":"2"} (接口所需入参)


Configuration

Required

DEPLOY_URL
部署接口地址,必须是完整的绝对 URL

DEPLOY_FILE
需要部署的目录路径,通常为 dist。


Optional

DEPLOY_TOKEN
部署接口鉴权 Token,如接口无需鉴权可不配置。

DEPLOY_META
自定义附加参数,必须是合法的 JSON 字符串。

注意:
.env 文件中的所有值都是字符串,
DEPLOY_META 只能写成单行 JSON。

正确示例:

DEPLOY_META={"key":"value"}


How it works

执行 frontend-deploy 时,会按以下流程运行:

  1. 校验构建目录是否存在
  2. 将构建目录压缩为 zip 文件(Node.js 实现,跨平台)
  3. 将 zip 文件上传到部署接口
  4. 上传完成后清理临时文件

CI Usage

GitLab CI 示例

deploy_testing: stage: deploy script: - npm ci - npm run build:deploy


Platform Support

  • Windows
  • macOS
  • Linux

本工具不依赖系统 zip 命令,在不同平台下行为一致。


Common Issues

Invalid URL

错误示例:

Invalid URL

原因:
DEPLOY_URL 使用了相对路径,例如:

DEPLOY_URL=/deploy-api/deploy/file

解决方式:
请使用完整的绝对地址,例如:

DEPLOY_URL=https://api.example.com/deploy-api/deploy/file


License

MIT