0.0.3 • Published 9 years ago

file-cloud-alioss-uploader v0.0.3

Weekly downloads
7
License
MIT
Repository
github
Last release
9 years ago

NPM version Build Status Dependency Status

Aliyun oss uploader

Install

$ npm install --save file-cloud-alioss-uploader

Usage

var fileCloudAliossUploader = require('file-cloud-alioss-uploader');

    var config = {
      accessKeyId: process.env.ALIYUN_OSS_ACCESS_KEY_ID,
      secretAccessKey: process.env.ALIYUN_OSS_ACCESS_KEY_SECRET,
      endpoint: process.env.ALIYUN_OSS_ENDPOINT,
      apiVersion: process.env.ALIYUN_OSS_APP_VERSION,
      Bucket: process.env.ALIYUN_OSS_BUCKET
    };
    fileCloudAliossUploader(function (error, data) {
      //error: false
      //data.ETag
      //data.RequestId
    }, path.resolve(__dirname, 'assets/a.jpg'), config);
$ npm install --global foss
$ foss --help

$ foss  a.txt aliyun.json

$ foss a.jpg aliyun.json --type md5

$ foss a.jpg aliyun.json --type md5 --case upper

License

MIT © calidion