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

@dllcnx/auto-deploy

v2.1.1

Published

自动部署脚本

Downloads

4

Readme

使用方法:

原项目@dllcn/auto-deploy的升级版,原账号因为邮箱的问题无法接着迭代发布。

  1. 下载项目
npm install @dllcnx/auto-deploy -D
  1. package.jsonscripts添加执行命令
    "deploy": "node ./node_modules/@dllcnx/auto-deploy"
  1. 在项目根目录创建deploy.config.js文件,可配置多个发布服务,例如以下配置了三个:
// 配置示例,具体配置看配置
module.exports = Object.freeze({
    ftp: {//ftp配置
        NAME: "ftp发布",
        SERVER_HOST: 'xxx', // 服务器地址
        USER: 'root', // 用户名
        PASSWORD: 'xxx', //密码,需加密,加密页面参考下面链接
        REMOTE_ROOT: '/web/test/', // 需要上传的服务器目录地址 如 /usr/local/nginx/html
        LOCAL_PATH: "dist", // 需要上传文件夹路径,默认dist
        PORT: 5521,
        TYPE: "ftp",  // ftp,sftp,ssh 模认ssh
        FTP_CONFIG:{
            DELETE_REMOTE: true,
            ...
        }
    },
    sftp: {//ftp配置
        NAME: "sftp发布",
        SERVER_HOST: 'xxx', // 服务器地址
        USER: 'root', // 用户名
        PASSWORD: 'xxx', //密码,需加密,加密页面参考下面链接
        REMOTE_ROOT: '/web/test/', // 需要上传的服务器目录地址 如 /usr/local/nginx/html
        LOCAL_PATH: "dist", // 需要上传文件夹路径,默认dist
        PORT: 5521,
        TYPE: "ftp",  // ftp,sftp,ssh 模认ssh
        FTP_CONFIG:{
            DELETE_REMOTE: true,
            ...
        }
    },
    ssh: {//ssh
        NAME: "sftp发布",
        SERVER_HOST: 'xxx',
        USER: 'root',
        //方式一 用秘钥登录服务器(推荐), private 本机私钥文件地址(需要在服务器用户目录 一般是 /root/.ssh/authorized_keys 配置公钥 并该文件权限为 600, (.ssh文件夹一般默认隐藏)
        // PRIVATE_KEY: 'C:/Users/Html5/.ssh/id_rsa',
      	//方式二,密码
        PASSWORD: 'xxx',//密码,需加密,加密页面参考下面链接
        REMOTE_ROOT: '/var/local/llcn', // 需要上传的服务器目录地址 如 /usr/local/nginx/html
        LOCAL_PATH: 'dist/',  // 需要上传文件夹路径,默认dist
        PORT: 22,
        SSH_CONFIG: {
            BACKUP: true,
            ...
        }
    }
})
  1. 执行npm run deploy发布命令

image-20230117231310216

配置

基础配置

  • name: 配置名称,默认采用key值
  • SERVER_HOST: 服务器地址
  • USER: 服务器用户名
  • PASSWORD: 密码
  • PRIVATE_KEY: [ssh推荐授权配置,与PASSWORD选用一样即可],用秘钥登录服务器(推荐)的秘钥地址, private 本机私钥文件地址(需要在服务器用户目录 一般是 /root/.ssh/authorized_keys 配置公钥 并该文件权限为 600, (.ssh文件夹一般默认隐藏)
  • LOCAL_PATH: 需要上传文件夹路径,默认dist
  • REMOTE_ROOT: 服务器路径
  • PORT: 端口
  • LOADINGSTYLE: [非必须],进度动画,默认为 arrow4 加载动画 有 dotsdots12dots6,line ,pipe ,star, arrowarrow4 等等
  • TYPE:[非必须],上传方式,默认ssh,还可选择ftpsftp
  • SSH_CONFIG: [非必须],ssh模式下的扩展配置
  • FTP_CONFIG:[非必须],ftp和sftp模式下的扩展配置

SSH_CONFIG

  • SSH_CONFIG.BACKUP: 是否备份,默认false
  • SSH_CONFIG.DELETE_LOCAL_PACKAGE: 成功后是否删除本地压缩包,默认false
  • SSH_CONFIG.BUILD_SHELL: 是否启动自动上传前编译,如果启用,填入编译命令
  • SSH_CONFIG.EXTENDS: 任务结束后,有时有的操作需要其他命令支持,可以使用扩展,填入自己要用的命令数组.例如:['cd demo', 'rm -rf *']

FTP_CONFIG

  • FTP_CONFIG.DELETE_REMOTE: 如果为真,则在上传前删除目标上的所有现有文件
  • FTP_CONFIG.INCLUDE: 默认["*", "*\**"], 将上传除.开头文件以外的所有文件
  • FTP_CONFIG.EXCLUDE: 模认排除sourcemaps和node_modules中的所有文件(包括.开头文件)
  • FTP_CONFIG.FORCEPASY: 强制被动模式(未发送EPSV命令)

加密页面

在线加密页面或者直接访问项目根目录单页面,加密目前只是简单混淆,防止密码明文直接暴漏到配置文件,但是会查看源码依旧存在暴漏风险,所以建议ssh的key模式授权登录。