lib/index.js
function getObject(host, accessKey, secretKey, bucket, objectKey) {
    var expires = arguments.length <= 5 || arguments[5] === undefined ? 0 : arguments[5];
    var opts = arguments.length <= 6 || arguments[6] === undefined ? {} : arguments[6];

    var date = utcDate();

    if (opts.versionId) url += '?versionId=' + opts.versionId;
    var resource = genResource(bucket, objectKey, (0, _lodash.pick)(opts, ['versionId']));
    var signature = encodeURIComponent(generateSignature(secretKey, 'GET', '', '', expires, [], resource));
    var url = pub ? 'http://' + bucket + '.' + host + '/' + objectKey : 'http://' + host + '/' + bucket + '/' + objectKey + '?NOSAccessKeyId=' + accessKey + '&Expires=' + expires + '&Signature=' + signature;
    var headers = { Date: date };
    if (opts.range) headers.Range = opts.range;
    if (opts.modifiedSince) headers['If-Modified-Since'] = opts.modifiedSince;
    headers['url'] = url;
    return nosRequest({ method: 'get', headers: headers, uri: url });
}
function getObject(host, accessKey, secretKey, bucket, objectKey) {
    var expires = arguments.length <= 5 || arguments[5] === undefined ? 0 : arguments[5];
    var opts = arguments.length <= 6 || arguments[6] === undefined ? {} : arguments[6];

    var date = utcDate();

    if (opts.versionId) url += '?versionId=' + opts.versionId;
    var resource = genResource(bucket, objectKey, (0, _lodash.pick)(opts, ['versionId']));
    var signature = encodeURIComponent(generateSignature(secretKey, 'GET', '', '', expires, [], resource));
    var url = pub ? 'http://' + bucket + '.' + host + '/' + objectKey : 'http://' + host + '/' + bucket + '/' + objectKey + '?NOSAccessKeyId=' + accessKey + '&Expires=' + expires + '&Signature=' + signature;
    var headers = { Date: date };
    if (opts.range) headers.Range = opts.range;
    if (opts.modifiedSince) headers['If-Modified-Since'] = opts.modifiedSince;
    headers['url'] = url;
    return nosRequest({ method: 'get', headers: headers, uri: url });
}
读取对象内容
@param {String} accessKey
@param {String} secretKey
@param {String} bucket
@param {String} objectKey
@param {Object} [opts]
@param {String} [opts.versionId] 版本
@param {String} [opts.modifiedSince]
@param {String} [opts.range] 用于断电续传
@returns {Promise}