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

gulp-upload-qcloud

v1.3.0

Published

cos upload gulp plugin

Downloads

9

Readme

gulp-upload-qcloud

腾讯云上传 gulp 插件

Install

npm install --save-dev gulp-upload-qcloud

Usage

const gulp = require('gulp');
const uploadQcloud = require('gulp-upload-qcloud');

gulp.task('upload', () => {
  return gulp.src(['test/**/*.*'])
    .pipe(uploadQcloud({
      AppId: 'STRING_VALUE',
      SecretId: 'STRING_VALUE',
      SecretKey: 'STRING_VALUE',
      Bucket: 'STRING_VALUE',
      Region: 'STRING_VALUE',
      Prefix: 'demo/sub',
      Headers: {
        CacheControl: 'max-age=31536000'
      },
      OverWrite: false
    }));
});

API

uploadQcloud([options])

options

Type: Object

There are 7 options:

  • AppId(string): 注册或登录 腾讯云 获取您的AppId。
  • SecretId(string): 到 腾讯云控制台密钥管理 获取您的项目 SecretId 和 SecretKey。
  • SecretKey(string): 同 SecretId。
  • Bucket(string): 到 COS 对象存储控制台 创建存储桶,得到 Bucket(存储桶名称) 和 Region(地域名称)。
  • Region(string): Bucket 所在区域。枚举值请见:Bucket 地域信息
  • Prefix(string): 自定义文件前缀,例如本地文件路径 img.png ,设置了 Prefix: 'demo',最终腾讯云路径为 demo/img.png,默认为空。
  • Headers(object): 设置头信息,具体 API 参考简单上传-参数说明
  • OverWrite(string): 是否覆盖同名文件,默认 false。
! AppIdBucket 的说明:

腾讯云官方 api 修改,去掉 AppId 概念,Bucket 需要传入这样的格式 test-1250000000。本插件,兼容两种配置方式,示例如下:

// old api options
const options = {
  AppId: 'your AppId',
  Bucket: 'old Bucket',
  ...
};
// new api options
const options = {
  Bucket: 'AppId-Bucket',
  ...
};

TIPS

该插件基于 腾讯云 COS Nodejs SDK V5 构建,可参考腾讯云官方文档 Node.js SDK