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

xdeploy-cli

v1.0.1

Published

前端快速部署项目cli工具

Downloads

4

Readme

前端部署工具 xdeploy-cli

如果对您有帮助,请您点个Star,谢谢!

描述

这是一个能够帮助前端工程师快速将项目部署的cli小工具。

包含的功能有在当前目录下全自动打压缩包,全自动连接ftp或者ssh将文件上传到服务器中,并支持线上文件备份

安装

npm install -g xdeploy-cli

配置文件

在项目目录下执行 xdeploy init 创建xdeploy.json

// xdeploy.json
{
  "local": {
    "outputDir": "dist",   //build输出文件夹
    "buildCommand": "yarn build", //项目打包命令
    "zipDefaultName": "压缩包默认名称",  //压缩包默认名称 打压缩包时需要
    "outputZipDir": "package"  //想要存储压缩包文件夹名称
  },
  "server": [
    {
      "alias": "xx系统:公司测试机",  // 服务器标识 可自定义 
      "type": "ssh",  //部署方式 可选值 ssh ftp 必填 填了啥类型在下边就配置啥服务器
      "ssh": {					//ssh配置
        "host": "xxx.baidu.com", //必填
        "port": "8527",    //选填 默认为22
        "username": "ubuntu", //必填
        "password": "xxx", //password 与 privateKey 选填 推荐使用 privateKey
        "privateKey": ""  //ssh 私钥所在路径
      },
      "ftp": {   //ftp配置
        "host": "xxx.baidu.com",//必填
        "port": "21",  //选填 默认为21
        "user": "ubuntu",  //必填
        "password": "ubuntu",  //必填
        "connTimeout": 60000,  //必填
        "pasvTimeout": 60000,//必填
        "keepalive": 60000//必填
      },
      "project": {
        "backup": false,  //是否备份 为true时 在服务器部署路径下会生成一个backup文件夹.并将原文件压缩 仅针对ssh
        "path": "/www/wwwroot/html/baidu", //线上部署路径 
        "rmExclude": ["backup","ie","config"] //清空线上文件时跳过哪些文件 仅针对ssh
      }
    }
  ]
}

使用方式

在项目目录下执行 xdeploy init 创建xdeploy.json。

  • 压缩项目 在当前目录下生成项目压缩包

​ 执行xdeploy -p,此时程序会根据xdeploy.json中buildCommand进行打包并将dist文件夹的内容压缩到package目录下,生成一个带有打包时间的压缩包

  • 部署到服务器

xdeploy -s 以ssh方式部署

xdeploy -f 以ftp方式部署

​ 程序会将项目build之后,根据配置,连接服务器,并上传到project.path文件夹 注意,此操作会清空project.path文件夹下的所有内容