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

sw-uploader

v1.0.3

Published

上传文件至服务器

Downloads

2

Readme

sw-oss-uploader cli工具

开始使用

全局安装 sw-oss-uploader

npm install -g sw-oss-uploader

在项目根目录生成 .env.local 配置文件

sw-uploader c

在配置文件添加服务器基本相关信息

.env.local 配置文件示例

# 阿里云oss基本配置项

SW_OSS_UPLOADER_ALIYUN_REGION = 'oss-cn-hangzhouxxx'   
SW_OSS_UPLOADER_ALIYUN_ACCESSKEYID = 'LTAI5t62xxxxxxxxx'  
SW_OSS_UPLOADER_ALIYUN_ACCESSKEYSECRET = 'FJjlpwvxxxxxx'  
SW_OSS_UPLOADER_ALIYUN_BUCKET = 'aliyun-wb-test01'  
SW_OSS_UPLOADER_ALIYUN_LOCAL_INPUT_PATH = './dist' # 本地要上传的资源路径,一般是build后的包路径,如果uni开发的h5项目路径一般为 ./dist/build/h5,路径不需要/结尾  
SW_OSS_UPLOADER_ALIYUN_OSS_OUT_PATH_TEST = 'test/sw-oss-test/admin' # 目标oss测试环境路径,注意路径不要加上bucket根地址,路径不需要/结尾  
SW_OSS_UPLOADER_ALIYUN_OSS_OUT_PATH_PROD = 'test/sw-oss-prod/admin' # 目标oss生产环境路径,注意路径不要加上bucket根地址,路径不需要/结尾  

上传文件

1,打包好文件
比如:npm run build


2,开始上传
一般项目
sw-uploader u

企客通项目(因为该项目在部署的时候将需要将 public/jump_weapp.html、public/eruda.js 文件拷贝复制dist/build/h5中,所以需要在命令行后添加 qkt 参数)
sw-uploader u qkt

⚠️重要提示

确保目标oss的路径是正确的
因为上传文件是覆盖的操作,错误的路径将会导致其路径下的文件被删除,不可逆的行为
SW_OSS_UPLOADER_ALIYUN_OSS_OUT_PATH_TEST // 目标oss测试环境路径,注意路径不要加上bucket根地址,路径不需要/结尾 SW_OSS_UPLOADER_ALIYUN_OSS_OUT_PATH_PROD // 目标oss生产环境路径,注意路径不要加上bucket根地址,路径不需要/结尾