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 🙏

© 2025 – Pkg Stats / Ryan Hefner

@yangss/webhooks-server

v0.0.1

Published

An auto build and deploy tool for front-end projects based on Github webhooks and Nodejs.

Readme

webhooks-server

一个基于 Github webhooks 和 nodejs 的前端项目自动部署工具

Installation

确保服务器上已经安装好 nodegit,并配置好环境变量。

该工具使用 pm2 来管理 hooks 进程,需要全局安装 pm2 (如果已安装请忽略这一步):

# npm
npm install -g pm2
# yarn
yarn global add pm2

全局安装 webhooks-server :

# npm
npm install -g @yangss/webhooks-server
# yarn
yarn global add @yangss/webhooks-server

Usage

webhooks config my-project
webhooks start -p 5000

注意:在启动 webhooks-server 之前,请确保需要进行自动打包部署的项目已克隆到服务器本地,并安装好项目依赖。同时需要配置好 git 凭据,确保可以免密与 git 远程仓库通信。

服务启动之后,就可以将 http://[ip]:5000/webhooks(ip 为你的服务器的公网 ip) 添加到 Github 上 my-project 项目仓库的 webhooks 配置中。

Command line Interface

webhooks config [project-name]

添加项目构建和部署的配置。

"project-name" 是你需要进行自动构建部署的项目名,应该与项目的 git 仓库名相同。 项目名称可以直接跟在 config 命令后面,如果不提供,则会在后续的 prompt 中进行询问:

webhooks config my-project
? project path: /apps/my-project    # 项目在服务器上的源码路径
? deploy path: /usr/www/my-project  # 项目要部署的路径
? build branch: master              # 项目构建打包的分支,默认为 master 分支
? build command: npm run build      # 项目构建打包的命令,默认为 npm run build

这些配置信息会保存到用户目录的 $HOME/.webhooksrc.json 配置文件中,你也可以手动编辑这个文件来更新或添加配置。

webhooks config -l[--list] [project-name]

查看项目配置。

如果提供 project-name 参数,会列出该项目的配置,不提供则列出所有配置:

webhooks config -l my-project
{
  projectPath: '/apps/my-project',
  deployPath: '/usr/www/my-project',
  buildBranch: 'master',
  buildCmd: 'npm run build'
}

webhooks start

启动 hooks 服务。

该命令会在后台启动一个 node 服务,默认监听 33333 端口。也可以通过 -p, --port 选项来指定端口号:webhooks start -p 5000

webhooks restart

重启 hooks 服务

webhooks stop

终止 hooks 服务