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

@scat1995/deployer

v2.1.3

Published

Dist folder Uploader

Readme

@scat1995/deployer

@scat1995/deployer 是一款基于 ssh2-sftp-clientssh2@scat1995/archiver 封装的文件上传插件,支持 webpackviterollup,可以实现将打包好的项目文件一键上传到指定的sftp服务器目录,支持集成为webpackviterollup 插件或单独使用,支持自动创建上传目录。

Install

NPM

yarn add @scat1995/deployer --save-dev
npm install @scat1995/deployer --save-dev

Configuration

Basic

{
  dir: path.join(__dirname, 'dist/'), // 需要上传文件的目录
  url: '******', // 上传到的目录
  host: '*****', // sftp地址
  port: '*****', // sftp端口
  username: '*****', // 账号
  password: '*****', // 密码
  // 延迟上传时间(毫秒),解决部分项目会触发多次打包完成的问题
  delay: 0,
  // 上传文件过滤器,可以过滤掉不需要的文件,返回false将不会上传该文件(可选)
  uploadFilter(file) => file.name.endsWith(.gz),
  // 删除文件过滤器,可以过滤掉不需要删除的文件,返回false将不会删除该文件(可选)
  deleteFilter(file) => file.name.endsWith(.gz),
  // 预览链接接地址(可选)
  previewPath: 'https://www.baidu.com'
}

Advanced: Upload Mode (For 2.0.0+)

'archiver' Mode

Will package the local directory into a compressed archive and upload as a single file, then extract on the remote server (fast, low bandwidth)

{
  ...
  mode: 'archiver',
  archiveFormat: 'tar',
  removeRemoteArchive: true
  ...
}

'sftp' Mode

Will upload individual files one by one via SFTP (original behavior)

{
  ...
  mode: 'sftp'
  ...
}

Usage

package.json

{
  // package.json
  // 1. window
  "scripts": {
    "build": "vue-cli-service build --mode development",
    "deploy": "set UPLOAD=true && yarn build"
  },
  // 2. liunx or macos
  "scripts": {
    "build": "vue-cli-service build --mode development",
    "deploy": "export UPLOAD=true && yarn build"
  }
}

Webpack

// vue.config.js
const DeployerWebpackPlugin = require('@scat1995/deployer')

module.exports = {
  configureWebpack: config => {
    return {
      plugins: [
        new DeployerWebpackPlugin({ ... })
      ]
    }
  }
}

Vite

//vite.config.js
import VitePluginDeployer from '@scat1995/deployer'

export default defineConfig({
  plugins: [
    VitePluginDeployer({ ... })
  ]
})

NodeJs

// 1. 在项目中创建uploader.js
// 2、配置和webpack插件模式相同

// For 1.0.0 ~ 2.0.0
const Deployer = require('@scat1995/deployer').default
// For 2.1.0
const Deployer = require('@scat1995/deployer')
Deployer.exec({ ... })
// 然后在项目根目录终端下运行如下命令
node uploader.js