1.1.0 • Published 2 years ago
@wxfly/qiniu-tool v1.1.0
@wxfly/qiniu-tool
七牛上传工具
安装
Using npm:
$ npm i @wxfly/qiniu-tool
使用
npm命令使用
package.json中添加命令
{
"scripts": {
"push": "wxfly-qiniu"
}
}
创建 qiniu-config.js文件 或者通过命令中传入文件路径(相对于终端路径)
npm run push ./test/qiniu-config.js
下面为测试参数,请勿线上使用
module.exports = {
accessKey: 'icWlsqwotf8WW0w8HZjEQ-pt82OwGV-ovr4grTGX',
secretKey: 'kIMgIufG5FRmoEEhlXUFbc5hMLOvKx2BZ2HIixcD',
domain: '//wxfx.hhooke.cn/',
zone: 'Zone_z1',
options: {
scope: 'wxfly-server'
},
localPath: './test/upload',
remotePath: 'mytest2/',
overwriting: false // 覆盖上传?
}
代码中使用
const qiniuPush = require('@wxfly/qiniu-tool')
qiniuPush({
accessKey: 'icWlsqwotf8WW0w8HZjEQ-pt82OwGV-ovr4grTGX',
secretKey: 'kIMgIufG5FRmoEEhlXUFbc5hMLOvKx2BZ2HIixcD',
domain: '//wxfx.hhooke.cn/',
zone: 'Zone_z1',
options: {
scope: 'wxfly-server'
},
localPath: './test/upload',
remotePath: 'mytest2/',
overwriting: false // 覆盖上传?
})