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

@varlet/release

v1.2.0

Published

publish all packages, generate changelogs and check commit messages

Readme

介绍

Varlet Release 是一个用于发布所有包、生成变更日志和检测 commit message 的辅助工具,依赖于 pnpm

  • 📦 开箱即用:零配置的极简发布体验
  • 🤖 直观交互:提供非常友好的交互式终端提示
  • 🛠 规范驱动:自动校验 Git Commit 并生成标准 Changelog
  • 🔗 深度扩展:支持命令行调用与 Node.js API 无缝扩展

Varlet Release 需要 Node.js ^20.19.0 || >=22.12.0,并且仅支持 esm

安装

pnpm add @varlet/release -D

使用

核心工作流

执行 vr release 时,背后会自动完成以下流程(保障每一步的严谨性):

  1. 交互式选择/确认要发布的版本号
  2. 执行用户自定义的额外 task 操作(可选,如重新构建以注入新版本号)
  3. 自动修改工程中的版本号信息
  4. 自动生成符合规范的 Changelog
  5. Git 提交 (Commit) 与打标签 (Tag)
  6. 发布至 npm

命令行使用

# 发布所有包并执行完整工作流程
npx vr release

# 指定远程仓库名称
npx vr release -r https://github.com/varletjs/varlet-release
# 或
npx vr release --remote https://github.com/varletjs/varlet-release

# 仅生成变更日志
npx vr changelog

# 指定变更日志文件名
npx vr changelog -f changelog.md
# 或
npx vr changelog --file changelog.md

# 检测 commit message 是否符合规范
npx vr lint-commit -p .git/COMMIT_EDITMSG

# 发布到 npm(通常在 CI/CD 中执行)
npx vr publish

Git Hooks 集成 (推荐最佳实践)

建议在 package.json 中配合 simple-git-hookshusky 使用 commit-lint,在开发者提交代码时自动触发校验:

{
  "simple-git-hooks": {
    "commit-msg": "npx vr lint-commit -p $1"
  }
}

配置参考

release

| 参数 | 说明 | 默认值 | | ------------------------- | ----------------------------------------------------------------------- | -------- | | -r --remote <remote> | 指定远程仓库名称 | origin | | -s --skip-npm-publish | 跳过 npm 发布 | false | | -c --check-remote-version | 检测 npm 包的远程版本是否与要在本地发布的包版本相同,如果是,则停止执行 | false | | -sc --skip-changelog | 跳过生成变更日志 | false | | -sgt --skip-git-tag | 跳过 git tag | false | | -nt --npm-tag <npmTag> | npm tag | - |

changelog

| 参数 | 说明 | 默认值 | | ----------------------------------- | ------------------ | -------------- | | -f --file <filename> | 指定变更日志文件名 | CHANGELOG.md | | -rc --releaseCount <releaseCount> | 发布数量 | 0 | | -p --preset <preset> | 指定变更预设 | angular |

lint-commit

| 参数 | 说明 | | ------------------------------- | --------------------------------------------------------------------------- | | -p --commitMessagePath <path> | 提交 git message 的临时文件路径。git 钩子 commit-msg 会传递这个参数。 | | -r --commitMessageRe <reg> | 验证 commit message 是否通过的正则 | | -e --errorMessage <message> | 验证失败展示的错误信息 | | -w --warningMessage <message> | 验证失败展示的提示信息 |

publish

| 参数 | 说明 | 默认值 | | ------------------------- | --------------------------------------------------------------------- | ------- | | -c --check-remote-version | 检测npm包的远程版本是否与要在本地发布的包版本相同,如果是,则跳过发布 | false | | -nt --npm-tag <npmTag> | npm tag | - |

Node API 自定义处理

除了命令行,你也可以使用 Node.js API 结合内部逻辑编写发布脚本。

示例代码

import { changelog, release } from '@varlet/release'

// 执行默认发布流程
release()

你可以传入一个 task 函数,在版本号变更之后、发布到 npm 等后续操作之前被调用。

import { changelog, release } from '@varlet/release'

async function task(newVersion, oldVersion) {
  await doSomething1()
  await doSomething2()
}

release({ task })

许可证

MIT