0.0.3 • Published 6 years ago

alioss-uploader v0.0.3

Weekly downloads
13
License
-
Repository
github
Last release
6 years ago

alioss-uploader

aliyun oss 上传脚本

支持glob格式文件路径匹配 node-glob

.uploader.js

var AliossUploader = require('alioss-uploader');

var uploader = new AliossUploader({
  uploadPath: './dist/**/*.{js,css,ico,png}',
  region: 'oss-cn-beijing',
  accessKeyId: 'xxxxxxxxxxxxxxxx',
  accessKeySecret: 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx',
  bucket: 'my-bucket',
  internal: false, // 是否内网(默认false)
  generateObjectPath: function(filename, file) {
    return 'projectName/' + file.replace('./dist/', '');
  },
  getObjectHeaders: function(filename) {
    return {
      Expires: 20000,
    }
  },
});

uploader.start()
0.0.3

6 years ago

0.0.2

6 years ago

0.0.1

6 years ago