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

aliyun-oss-upload-cli

v1.0.1

Published

aliyun oss 上传工具

Downloads

4

Readme

阿里云oss上传文件--JS工具

cli用法

  • 安装
npm i -g @ubt/aliyun-oss-js-cli
  • 参数
Usage: ali-oss-cli [options]

Options:
  -r, --region <region>           设置OSS bucket地区: https://help.aliyun.com/zh/oss/user-guide/regions-and-endpoints
  -i, --id <accessKeyId>          设置OSS bucket accessKeyId.
  -s, --secret <accessKeySecret>  设置OSS bucket accessKeySecret.
  -b, --bucket <bucketName>       设置OSS bucket名称
  -f, --file <filePath>           设置需要上传的本地文件
  -d, --dir <directoryPath>       设置需要上传的本地目录。--file和--dir只能选一个
  -t, --target <targetPath>       设置上传的目标文件、目录路径
  -o, --override <override>       设置是否覆盖已存在的文件
  -p, --parallel <count>          设置并行上传任务数
  -h, --help                      查看帮助
  • 例如
  ali-oss-cli -r 'oss-cn-shenzhen' -i osidjfoiewofwef -s soifjowejfki3jfoisof -b 'xxxvv' -d '/home/ci/xxx/dist/' -t 'temp/xxx/dist' -o false -p 3

function call 用法

import { uploadSingleFile, uploadFolder } from '@ubt/aliyun-oss-js-cli'

// 上传一个文件
uploadSingleFile(
  {
    region: 'oss-cn-shenzhen',
    accessKeyId: 'sjdofijoiweijfwe',
    accessKeySecret: 'joisjeofiwjeofjsefwefsdf',
    bucket: 'oss-test',
  },
  '/home/user/abc.txt',
  'temp/abc.txt',
)

// 上传目录
uploadFolder(
  {
    region: 'oss-cn-shenzhen',
    accessKeyId: 'sjdofijoiweijfwe',
    accessKeySecret: 'joisjeofiwjeofjsefwefsdf',
    bucket: 'oss-test',
  },
  '/home/user/abc.txt',
  'temp/abc.txt',
  false,
  5,
)

附:阿里云oss region

https://help.aliyun.com/zh/oss/user-guide/regions-and-endpoints

| OSS bucket地区 | Region 参数取值 | | ---------------------- | --------------------- | | 华东1(杭州) | oss-cn-hangzhou | | 华东2(上海) | oss-cn-shanghai | | 华东5(南京-本地地域) | oss-cn-nanjing | | 华东6(福州-本地地域) | oss-cn-fuzhou | | 华中1(武汉-本地地域) | oss-cn-wuhan | | 华北1(青岛) | oss-cn-qingdao | | 华北2(北京) | oss-cn-beijing | | 华北 3(张家口) | oss-cn-zhangjiakou | | 华北5(呼和浩特) | oss-cn-huhehaote | | 华北6(乌兰察布) | oss-cn-wulanchabu | | 华南1(深圳) | oss-cn-shenzhen | | 华南2(河源) | oss-cn-heyuan | | 华南3(广州) | oss-cn-guangzhou | | 西南1(成都) | oss-cn-chengdu | | 中国香港 | oss-cn-hongkong | | 美国(硅谷) | oss-us-west-1 | | 美国(弗吉尼亚) | oss-us-east-1 | | 日本(东京) | oss-ap-northeast-1 | | 韩国(首尔) | oss-ap-northeast-2 | | 新加坡 | oss-ap-southeast-1 | | 澳大利亚(悉尼) | oss-ap-southeast-2 | | 马来西亚(吉隆坡) | oss-ap-southeast-3 | | 印度尼西亚(雅加达) | oss-ap-southeast-5 | | 菲律宾(马尼拉) | oss-ap-southeast-6 | | 泰国(曼谷) | oss-ap-southeast-7 | | 印度(孟买) | oss-ap-south-1 | | 德国(法兰克福) | oss-eu-central-1 | | 英国(伦敦) | oss-eu-west-1 | | 阿联酋(迪拜) | oss-me-east-1 | | 无地域属性(中国内地) | oss-rg-china-mainland |