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

@hotsuitor/upload-dist

v1.1.0

Published

A cli upload dist directory.

Downloads

9

Readme

Introduction

nodejs 脚本实现上传前端打包目录 dist。用到 ssh2-sftp-client 这个包实现上传功能。 在项目根目录运行 upload-dist 把打包后的 dist 目录上传到服务器

服务器上的 dist 目录内容会被清空后,再上传

Installation

npm install -D @hotsuitor/upload-dist
# or
yarn add -D @hotsuitor/upload-dist

Example

在项目根目录下新建 .env.local 文件,示例配置:

DEBUG=false
SFTP_SERVER=127.0.0.1
SFTP_USER=username
SFTP_PASSWORD=password
SFTP_PORT=22
BUILD_DIR=../dist
DESTINE_DIR=/var/www/test/
  • SFTP_SERVER 服务器ip
  • SFTP_USER 服务器登录用户
  • SFTP_PASSWORD 服务器登录密码
  • BUILD_DIR 打包文件目录,相对路径
  • DESTINE_DIR 远程服务器存放路径,绝对路径

默认读取的配置文件是根目录下的 .env.local 配置文件

配置参数

A cli to upload file to service.
一个用来上传文件的cli工具。

  The cli can upload file to service by command. It does not need a sftp
  client. It is configurable.
  一个用命令上传文件的工具,可以方便前端开发打包后上传dist文件到服务器,
  支持参数配置。

Options

  -v, --version Boolean        Print current version
  -h, --help Boolean           Print this usage guide.
  -c, --config String          The file of configuration. It is consist of
                               dotenv file. Default profile is ".env.local"
  -host, --host String         The host of service
  -u, --username String        The username of service
  -pwd, --password String      The password of service
  -p, --port Number            The port of service ssh. Default is 22
  -s, --sourceFile String      The file wanted to upload service. Using
                               relative path.
  -d, --destFile String        The file is want to save on service. Using
                               absolute path.
  -t, --test Boolean           Test connect.
  -i, --ignore String|RegExp   Ignore file in source file. Default ignore file
                               include these "(.git, node_modules)"

Run

查看帮助

npx upload-dist -h

上传命令

npx upload-dist
  • [x] 增加参数读取指定配置文件 <-- 2023-4-25