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

c-deploy

v2.0.7

Published

node执行自动部署,可配置多环境,自动打包并部署到服务器上

Downloads

11

Readme

c-deploy

node执行自动部署,可配置多环境,自动打包并部署到服务器上

安装(局部)

npm i c-deploy -D
or
cnpm i c-deploy -D
or
yarn add c-deploy -D 

运行打包上传 (若不存在初始化文件将会自动生成)

npx c-deploy

生成初始化文件 (deploy.config.js)

npx c-deploy init

直接上传打包文件到服务器 (为了避免密码错误导致终止程序后重复打包)

npx c-deploy upload

帮助

npx c-deploy -h[help]

安装(全局)

npm i c-deploy -g
or
cnpm i c-deploy -g
or
yarn global add c-deploy

运行打包上传 (若不存在初始化文件将会自动生成)

c-deploy

生成初始化文件 (deploy.config.js)

c-deploy init

直接上传打包文件到服务器 (为了避免密码错误导致终止程序后重复打包)

c-deploy upload

帮助

c-deploy -h[help]

配置 deploy.config.js

module.exports = [
  // 一个对象为一个环境,多个环境将会询问部署环境,单环境会跳过询问
  {
    name: '测试环境dev', // 部署环境的名称(多环境名称不能重复)
    publicPath: 'dist', // 项目打包之后的文件夹名称,一般都是dist文件夹,如果你的项目打包成别的文件夹名称,填写打包之后文件夹名称即可
    script: 'npm run build', // 打包命令,不需要填空
    host: '', // 服务器ip
    port: '22', // 服务器连接端口通常不用改
    username: 'root', // 部署服务器的账号
    password: '', // 部署服务器的密码,如果重要,可以不写在当前配置文件中(为空运行时将要求输入密码)
    privateKey: '', // 部署服务器的密码私钥,填写私钥路径(从进程执行时的工作目录开始) 优先级 私钥 -> 密码 例:'/home/steel/.ssh/id_rsa' 不填写则寻找密码password
    servicePath: '', // 前端代码在服务器下的路径
    backupDist: true // 是否保留旧版本,为true后会对旧版本publicPath重命名(带时间)进行备份, 类型:Boolean true(当前目录进行备份) false(不备份), String(指定服务器目录进行备份)
  },
  {
    name: '正式环境pro', // 部署环境的名称(多环境名称不能重复)
    publicPath: 'dist', // 项目打包之后的文件夹名称,一般都是dist文件夹,如果你的项目打包成别的文件夹名称,填写打包之后文件夹名称即可
    script: 'npm run build', // 打包命令,不需要填空
    host: '', // 服务器ip
    port: '22', // 服务器连接端口通常不用改
    username: 'root', // 部署服务器的账号
    password: '', // 部署服务器的密码,如果重要,可以不写在当前配置文件中(为空运行时将要求输入密码)
    privateKey: '', // 部署服务器的密码私钥,填写私钥路径(从进程执行时的工作目录开始) 优先级 私钥 -> 密码 例:'/home/steel/.ssh/id_rsa' 不填写则寻找密码password
    servicePath: '', // 前端代码在服务器下的路径
    backupDist: true // 是否保留旧版本,为true后会对旧版本publicPath重命名(带时间)进行备份, 类型:Boolean true(当前目录进行备份) false(不备份), String(指定服务器目录进行备份)
  }
]

tips

需要服务器支持 unzip