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 🙏

© 2024 – Pkg Stats / Ryan Hefner

wr-server-cli

v1.0.3

Published

全局安装 wr-server-cli 工具包,该包使用的是 node esm 版本,需要使用 node20 以上版本;

Downloads

80

Readme

ssh 连接服务器自动部署

全局安装 wr-server-cli 工具包,该包使用的是 node esm 版本,需要使用 node20 以上版本;

安装完成后在项目根目录增加 deploy.config.mjs;该文件默认导出部署配置

interface EnvConfig {
  // 环境对象
  name: string; // 环境名称
  script: string; // 打包命令
  host: string; // 服务器地址
  port: number; // 服务器端口号
  password: string; // 服务器登录密码
  username: string; // 服务器登录用户名
  distPath: string; // 本地打包生成目录
  webDir: string; // 服务器部署路径(不可为空或'/')
  bakDir: string; // 备份路径 (打包前备份之前部署目录 最终备份路径为 /usr/local/nginx/backup/html.zip)
  isRemoveRemoteFile: boolean; // 是否删除远程文件(默认true)
  isRemoveLocalFile: boolean; // 是否删除本地文件(默认true)
  verifyAddress: string;
}
interface DeployConfig {
  projectName: string;
  readyTimeout: number;
  dev: EnvConfig;
  qa: EnvConfig;
  prod: EnvConfig;
}
export default {
  projectName: 'example', // 项目名称
  readyTimeout: 20000, // 超时时间 (毫秒)

  qa: {
    // 环境对象
    name: '测试环境', // 环境名称
    script: 'build:qa', // 打包命令
    host: 'example.com', // 服务器地址
    port: 22, // 服务器端口号
    username: 'root', // 服务器登录用户名
    distPath: 'dist', // 本地打包生成目录
    webDir: '/example/code', // 服务器部署路径(不可为空或'/')
    bakDir: '/front-end-backups', // 备份路径 (打包前备份之前部署目录 最终备份路径为 )
    isRemoveRemoteFile: true, // 是否删除远程文件(默认 true)
    isRemoveLocalFile: true, // 是否删除本地文件(默认 true)
    verifyAddress: 'http://example.com', // 验证页面地址
  },
};

配置完成后根目录执行 wr-server deploy -m dev/qa/prod,等待命令执行,按提示验证部署结果;