Comparing version 0.0.2 to 0.0.3
@@ -413,3 +413,2 @@ /*! | ||
var path = require('path'); | ||
var PassThrough = require('stream').PassThrough; | ||
var debug = require('debug')('ali-oss:client'); | ||
@@ -535,2 +534,3 @@ var copy = require('copy-to'); | ||
* - {Stream} [writeStream] | ||
* - {String} [mime] | ||
* | ||
@@ -557,3 +557,3 @@ * @api private | ||
if (params.content) { | ||
headers['Content-Type'] = mime.lookup(path.extname(params.name)); | ||
headers['Content-Type'] = mime.lookup(params.mime || path.extname(params.name)); | ||
headers['Content-Md5'] = crypto | ||
@@ -594,2 +594,3 @@ .createHash('md5') | ||
* - {Object} headers | ||
* - {String} mime | ||
* @param {Function} callback | ||
@@ -618,2 +619,3 @@ * | ||
timeout: timeout, | ||
mime: options.mime, | ||
method: 'PUT' | ||
@@ -642,2 +644,4 @@ }), "t2", 6); | ||
proto.put = proto.upload; | ||
/** | ||
@@ -668,3 +672,3 @@ * get an object from oss | ||
proto.get = wrapGenerator.mark(function(name, path, options) { | ||
proto.download = wrapGenerator.mark(function(name, path, options) { | ||
var writeStream, needDestroy, timeout, res; | ||
@@ -712,3 +716,3 @@ | ||
case 17: | ||
debug('get response %s', res.status); | ||
debug('get response %s, headers %j', res.status, res.headers); | ||
@@ -732,2 +736,4 @@ if (!(res.status === 200)) { | ||
proto.get = proto.download; | ||
/** | ||
@@ -773,2 +779,4 @@ * remove an object from oss | ||
proto.delete = proto.remove; | ||
/** | ||
@@ -775,0 +783,0 @@ * get content from string(file path), buffer(file content), stream(file stream) |
@@ -16,3 +16,2 @@ /*! | ||
var path = require('path'); | ||
var PassThrough = require('stream').PassThrough; | ||
var debug = require('debug')('ali-oss:client'); | ||
@@ -137,2 +136,3 @@ var copy = require('copy-to'); | ||
* - {Stream} [writeStream] | ||
* - {String} [mime] | ||
* | ||
@@ -154,3 +154,3 @@ * @api private | ||
if (params.content) { | ||
headers['Content-Type'] = mime.lookup(path.extname(params.name)); | ||
headers['Content-Type'] = mime.lookup(params.mime || path.extname(params.name)); | ||
headers['Content-Md5'] = crypto | ||
@@ -186,2 +186,3 @@ .createHash('md5') | ||
* - {Object} headers | ||
* - {String} mime | ||
* @param {Function} callback | ||
@@ -203,2 +204,3 @@ * | ||
timeout: timeout, | ||
mime: options.mime, | ||
method: 'PUT' | ||
@@ -216,2 +218,4 @@ }); | ||
proto.put = proto.upload; | ||
/** | ||
@@ -242,3 +246,3 @@ * get an object from oss | ||
proto.get = function* (name, path, options) { | ||
proto.download = function* (name, path, options) { | ||
var writeStream = null; | ||
@@ -276,3 +280,3 @@ var needDestroy = false; | ||
debug('get response %s', res.status); | ||
debug('get response %s, headers %j', res.status, res.headers); | ||
@@ -285,2 +289,4 @@ if (res.status === 200) { | ||
proto.get = proto.download; | ||
/** | ||
@@ -308,2 +314,4 @@ * remove an object from oss | ||
proto.delete = proto.remove; | ||
/** | ||
@@ -310,0 +318,0 @@ * get content from string(file path), buffer(file content), stream(file stream) |
{ | ||
"name": "ali-oss", | ||
"version": "0.0.2", | ||
"version": "0.0.3", | ||
"description": "aliyun oss(open storage service) node client", | ||
@@ -38,3 +38,3 @@ "main": "index.js", | ||
"co-read": "0.0.2", | ||
"co-urllib": "0.2.0", | ||
"co-urllib": "0.2.1", | ||
"copy-to": "0.0.3", | ||
@@ -41,0 +41,0 @@ "debug": "0.8.0", |
@@ -39,3 +39,3 @@ ali-oss | ||
#### upload | ||
#### upload, put | ||
@@ -53,4 +53,5 @@ ``` | ||
- headers: custom headers, checkout the doc | ||
- mime: file mime type, will send to `mime.lookup` | ||
#### get | ||
#### download, get | ||
@@ -69,3 +70,3 @@ ``` | ||
#### remove | ||
#### remove, delete | ||
@@ -72,0 +73,0 @@ ``` |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
37034
1144
101
1
+ Addedco-urllib@0.2.1(transitive)
- Removedco-urllib@0.2.0(transitive)
Updatedco-urllib@0.2.1