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 🙏

© 2025 – Pkg Stats / Ryan Hefner

deploy-sftp

v2.2.19

Published

This package is an automated deployment script for Vue.js projects. It enables deployments to development and production environments using Git and SFTP.

Readme

🚀 deploy-sftp

Um CLI para automação de deploy de projetos Vue.js via Git e SFTP.
Ele faz build, gerencia tags/branches e envia os arquivos para servidores de desenvolvimento e produção.


📋 Sumário


🔍 Recursos

  • Menu interativo para escolher ambiente: todos, dev ou prod
  • Build do projeto (yarn build ou npm run build)
  • Git flow completo: clone em pasta temporária, commit, tag, push
  • Upload de diretórios via SFTP com feedback em tempo real
  • Suporte a flags:
    • -g, --git → apenas fluxo Git (inclui build)
    • -s, --sftp → apenas upload SFTP (inclui build)
    • -v, --version → exibe a versão instalada
    • -h, --help → exibe esta ajuda

⚙️ Pré-requisitos

  • Node.js ≥ 14
  • Yarn ou npm
  • Acesso Git ao repositório remoto
  • Acesso SFTP ao servidor de destino

📥 Instalação

Instale globalmente para usar o comando deploy-sftp ou o alias deploy de qualquer lugar:

npm install -g deploy-sftp
# ou
yarn global add deploy-sftp

Isso cria dois comandos no seu PATH:

  • deploy-sftp
  • deploy

Ou adicione como dependência de desenvolvimento no seu projeto:

npm install --save-dev deploy-sftp
# ou
yarn add --dev deploy-sftp

Todas as dependências (dotenv, ssh2-sftp-client, yargs, inquirer, ora) são instaladas automaticamente.


🔧 Configuração

  1. Na raiz do seu projeto Vue, crie um arquivo .env com as variáveis abaixo.
  2. Ajuste valores de URL do repositório, credenciais Git e SFTP.
# Repositório Git
VITE_REPO_URL=https://github.com/usuario/projeto.git
[email protected]
VITE_GIT_USER=Seu Nome

# Build
VITE_BUILD_FOLDER=dist

# Ambiente DEV
VITE_FTP_HOST_DEV=dev.exemplo.com
VITE_FTP_PORT_DEV=22
VITE_FTP_USER_DEV=usuario_dev
VITE_FTP_PASS_DEV=senha_dev
VITE_FTP_DIRR_DEV=/var/www/dev

# Ambiente PROD
VITE_FTP_HOST_PROD=prod.exemplo.com
VITE_FTP_PORT_PROD=22
VITE_FTP_USER_PROD=usuario_prod
VITE_FTP_PASS_PROD=senha_prod
VITE_FTP_DIRR_PROD=/var/www/prod

Importante:

  • VITE_BUILD_FOLDER deve ser o diretório gerado pelo yarn build.
  • VITE_REPO_URL pode ser HTTPS ou SSH. Se for Bitbucket HTTPS, o script converterá para SSH automaticamente.

🚀 Uso

Via npx / NPX

npx deploy-sftp
# ou
npx deploy

Com pacote instalado globalmente

deploy-sftp
# ou
deploy

Como script no package.json

Adicione em "scripts":

{
  "scripts": {
    "deploy": "deploy-sftp",
    // ou
    "deploy": "deploy"
  }
}

E então:

npm run deploy
# ou
yarn deploy

🏳️ Flags disponíveis

  • -g, --git → somente fluxo Git (build + gitFlow)
  • -s, --sftp → somente upload SFTP (build + sftpUpload)
  • -v, --version → exibe a versão do CLI
  • -h, --help → exibe esta ajuda

🛠️ Exemplos de uso

# deploy completo (build + gitFlow + sftpUpload)
deploy

# apenas Git flow
deploy -g
# ou
deploy --git

# apenas SFTP
deploy -s
# ou
deploy --sftp

# ver versão
deploy -v

# ver ajuda
deploy -h

⚙️ Fluxo de Deploy

  1. Menu interativo para escolher ambiente: todos, dev ou prod.
  2. Executa build do Vue (yarn build).
  3. Clona branch alvo em pasta temporária.
  4. Substitui conteúdo por build atual.
  5. Configura Git (usuário/email).
  6. Seleciona ou cria nova tag.
  7. Commit + tag + push para repositório remoto.
  8. Realiza upload dos arquivos build via SFTP.
  9. Remove pasta temporária e encerra.

📄 Licença

Unlicense

😁 Feito por Marcos Paulo

https://marcospaulo.dev