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

m-ssh-deploy

v1.4.3

Published

微型自动部署插件

Readme

✨✨✨m-ssh-deploy✨✨✨

m-ssh-deploy是一个在没有jenkins或者其他大型部署系统下推荐使用的一款自动部署工具。能够简化手动部署流程,实现自动化过程,打包压缩上传到服务器一键执行。

部署出错、完成支持弹窗显示。

部署过程

源码地址 https://gitee.com/MaJXm21/m-deplot-tsc

📌Dome 样式 🍐

1.安装

先设置为npm源 npm config set registry http://registry.npmjs.org/

npm i m-ssh-deploy -D

2.在项目任意位置创建一个 deploy.js文件

const deploy = require('m-ssh-deploy').default

const deployConfig = {
  name: '某某项目名称', // 部署名称
  // 选择列表
  choices: [
    {
      name: '测试环境',
      value: 'development',
    },
    {
      name: '测试环境(debug)',
      value: 'development:debug',
    },
  ],
  // 配置列表
  deployList: [
    {
      VALUE: 'development', // 提供选择,跟choices的value
      SERVER_PATH: '192.168.100.100', // ssh地址 服务器地址
      SSH_USER: 'root', // ssh 用户名
      PASSWORD: 'root', // 用密码连接服务器
      PATH: '/home/app/dist', // 需要上传的服务器目录地址 如 /usr/local/nginx/html
      SCRIPT: 'npm run build:prod',
      ASSETS_PATH: 'dist', // 打包完后的目录
      SERVER_CMD: ['ls'], // 自定义在服务器上执行的指令,从左到右执行
      RUN_MODEL: 3, // 1:只打包 2:打包和压缩zip 3:打包、压缩zip、上传服务器 默认是3
    },
    { ... }
  ],
}

deploy(deployConfig) // 运行

3.在package.jsonscripts增加一个"deploy":"node ./deploy.js"

{
  ...,
  "scripts": {
    ...,
    "deploy": "node ./deploy.js"
  }
  ...
}

4.运行

npm run deploy

📌 选择部署

实现select人性化配套,支持多环境

人性化选择

📌 参数要求 🔌

|参数|说明|类型|可选择|默认值|必传| |---|---|---|---|---|---| |name|项目名称|string|—|—|✔| |choices|交互式选择列表,详细看下面 choices|array[object]|—|—|✔| |deployList|配置列表,详细下面 deployList|array[object]|—|—|✔|

choicesdeployList长度必须一致,才能匹配得上

choices

| 参数 | 说明 | 类型 | 可选择 | 默认值 | 必传 | | ----- | -------- | ------ | ------ | ------ | ---- | | name | 选项名称 | string | — | — | ✔ | | value | 选项的值 | string | — | — | ✔ |

deployList

| 参数 | 说明 | 类型 | 可选择 | 默认值 | 必传 | | ----------- | ---------------------------------------------------- | ------ | ------ | ------ | --------------------------------------- | | VALUE | 对应的是 choices[].value 的值 | string | — | — | ✔ | | SERVER_PATH | 服务器地如址 192.168.1.1 | string | — | — | RUN_MODEL === 3|4,必传 ✔ | | SSH_USER | 服务器登录用户名 | string | — | — | 同上 | | PASSWORD | 服务器登录密码 | string | — | — | 同上 | | PATH | 需要上传的服务器目录地址 | string | — | — | 同上 | | SCRIPT | 打包执行的命令比如 npm run build | string | — | — | RUN_MODEL=== 1|2|3,必传 ✔ | | ASSETS_PATH | 项目打包后的静态资源目录 | string | — | — | 同上 | | SERVER_CMD | 自定义服务器指令,从左到右执行 | array[string] | — | — | — | | RUN_MODEL | 选择模式,1:只打包、2:打包压缩、3:打包压缩上传、4:自定义服务器指令| number | 1,2,3,4 | — | ✔ |

内置指令

| 指令名 | 说明 | | --- | --- | | builtIn:1 | 打包 | | builtIn:2 | 压缩 | | builtIn:3 | 上传 | | builtIn:5 | 连接服务器 |

使用方式

这种方式只能在传模式(RUN_MODEL)为4的情况下使用,例如

  • SERVER_CMD: ['builtIn:1'] 打包
  • SERVER_CMD: ['builtIn:1', 'builtIn:2'] 打包和压缩