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

webpack-alioss-upload-plugin

v1.5.1

Published

A webpack plugin to upload files to aliyun oss, which supports multiple optional upload method

Downloads

6

Readme

webpack-alioss-upload-plugin

A flexible webpack plugin to upload files to aliyun oss, which supports multiple optional upload methods and parameters.

This plugin only works with webpack version above 4.0

Advantages

  • Supports 3 alternative upload methods that aliyun oss supports.

  • Supports multipart upload and retries at the breakpoints.

  • Can custom timeout to drop the request.

  • Can control how many http request threads are created at the meanwhile. Too many threads may result in an error returned from aliyun.

  • Can switch debug mode to decide whether or not showing verbose log.

Installation

npm i webpack-alioss-upload-plugin -D

or

yarn add webpack-alioss-upload-plugin -D

Usage

Here is a simplest usage.

const AliOSSUploadPlugin = require("webpack-alioss-upload-plugin");
// webpack config
module.exports = {
  plugins: [
    new AliOSSUploadPlugin({
      accessKeyId: "your.oss.accessKeyId",
      accessKeySecret: "your.oss.accessKeySecret",
      region: "your.oss.region",
      bucket: "your.oss.bucket"
    })
  ]
};

Options

  • accessKeyId: [String] the accessKeyId of your oss, required.
  • accessKeySecret: [String] the accessKeySecret of your oss, required.
  • region: [String] the region of your oss, required.
  • bucket: [String] the bucket name of your oss, required.
  • prefix: [String] the path to direct to files on oss, if configured, it looks like "https://${bucket}.${region}.aliyuncs.com/${prefix}/local-resolved-file-name", default ''.
  • uploadType: [String] has three types(put|stream|multipart), corresponding to alioss's upload methods(put|putStream|multipart), default multipart, more info see here.
  • uploadOptions: [Object]
    • parallel: [Number] the number of parts to be uploaded in parallel, default 4.
    • partSize: [Number] the suggested size for each part in KB, default 204800(200M), alioss's minimum partsize must larger than 100M.
    • timeout: [Number] the operation timeout in milliseconds, default 6000.
    • retries: [Number] retry times if multipart upload is interrupted, only work when uploadType is multipart
    • useChunk: [Boolean] whether or not use chunked encoding, only work when uploadType is stream, default false, more info see here.
  • concurrency: [Number] allow how many upload event to be created at the meanwhile, default 3, may your system may crash if this parameter is too large.
  • excludes: [RegExp|Array[RegExp]] files not wanting to upload to oss, default [].
  • debug: [Boolean] whether or not show verbose log on command line, default false.

Contribution and Issues

Feel free to contribute code or publish an issue, whenever you have any good idea or find a bug.

License

MIT

Author

Javen Leung