publish-web-qiniu

2.0.1 • Public • Published

publish-web-qiniu

通过正则匹配需要上传的文件后上传到七牛云

  • 已上传的文件不会再上传

安装

$ npm install --save-dev publish-web-qiniu

使用

var publishWeb = require('publish-web-qiniu');

publishWeb({
  webRoot: './dist',
  webGlobs: './**/*',
  qiniuAccess: '七牛云的access',
  qiniuSecret: '七牛云的secret',
  qiniuBucket: '上传到的bucket'
});

API

publishWeb(options)

options

webRoot

Type: string
Default: null

web根路径

webGlobs

Type: glob
Default: null

需要处理的文件glob,相对于options.webRoot目录

systemDir

Type: string
Default: ./.publish-web-qiniu

用于写入已上传文件,相对于options.webRoot目录

onCollect

Type: function
Default: null

  • 在收集文件时回调,传入参数(file),返回Promise,可在此修改文件内容
  • Promise对象应该resolve(file),如果resolve(false),则不上传该文件
onUpload

Type: function
Default: null

  • 在上传文件时回调,传入参数({key,path}),返回({key,path})
  • key为七牛云上传的key
  • path为上传的文件路径

License

MIT

Package Sidebar

Install

npm i publish-web-qiniu

Weekly Downloads

7

Version

2.0.1

License

MIT

Unpacked Size

10.4 kB

Total Files

9

Last publish

Collaborators

  • safaaa