cordova-promise-fs
Advanced tools
Comparing version 0.5.0 to 0.5.1
{ | ||
"name": "cordova-promise-fs", | ||
"main": "dist/CordovaPromiseFS.js", | ||
"version": "0.5.0", | ||
"version": "0.5.1", | ||
"homepage": "https://github.com/markmarijnissen/cordova-promise-fs", | ||
@@ -6,0 +6,0 @@ "authors": [ |
@@ -348,2 +348,3 @@ var CordovaPromiseFS = | ||
ft.download.apply(ft,args); | ||
if(ft.onprogress) ft.onprogress(new ProgressEvent()); | ||
} else { | ||
@@ -378,6 +379,8 @@ // Stupid API. 'upload' switched around the 'trustAllHosts' and 'options' arguments. | ||
if(!transferOptions.retry || !transferOptions.retry.length) { | ||
transferOptions.retry = options.retry.concat(); | ||
transferOptions.retry = options.retry; | ||
} | ||
transferOptions.retry = transferOptions.retry.concat(); | ||
var ft = new FileTransfer(); | ||
if(typeof onprogress === 'function') ft.onprogress = onprogress; | ||
var promise = new Promise(function(resolve,reject){ | ||
@@ -402,3 +405,2 @@ var attempt = function(err){ | ||
promise.then(nextTransfer,nextTransfer); | ||
if(typeof onprogress === 'function') ft.onprogress = onprogress; | ||
promise.progress = function(onprogress){ | ||
@@ -405,0 +407,0 @@ ft.onprogress = onprogress; |
@@ -301,2 +301,3 @@ /** | ||
ft.download.apply(ft,args); | ||
if(ft.onprogress) ft.onprogress(new ProgressEvent()); | ||
} else { | ||
@@ -331,6 +332,8 @@ // Stupid API. 'upload' switched around the 'trustAllHosts' and 'options' arguments. | ||
if(!transferOptions.retry || !transferOptions.retry.length) { | ||
transferOptions.retry = options.retry.concat(); | ||
transferOptions.retry = options.retry; | ||
} | ||
transferOptions.retry = transferOptions.retry.concat(); | ||
var ft = new FileTransfer(); | ||
if(typeof onprogress === 'function') ft.onprogress = onprogress; | ||
var promise = new Promise(function(resolve,reject){ | ||
@@ -355,3 +358,2 @@ var attempt = function(err){ | ||
promise.then(nextTransfer,nextTransfer); | ||
if(typeof onprogress === 'function') ft.onprogress = onprogress; | ||
promise.progress = function(onprogress){ | ||
@@ -358,0 +360,0 @@ ft.onprogress = onprogress; |
{ | ||
"name": "cordova-promise-fs", | ||
"version": "0.5.0", | ||
"version": "0.5.1", | ||
"description": "Cordova FileSystem convienence functions that return promises.", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -79,2 +79,5 @@ cordova-promise-fs | ||
### Upload and download | ||
FileTransfers with automatric retry and concurrency limit! | ||
```javascript | ||
@@ -86,2 +89,6 @@ var promise = fs.upload(source,destination,[options],[onprogress]); | ||
options.trustAllHosts | ||
options.retry = [1000,2000,3000] // retry attemps: millisecond to wait before trying again. | ||
// plus all normal cordova-file-transfer options | ||
// upload/download augments the promise with two extra functions: | ||
@@ -100,2 +107,4 @@ promise.progress(function(progressEvent){...}) | ||
fs.dirname(path) // converts path dirname (everything except part after last /) | ||
fs.deviceready // deviceready promise | ||
fs.options // options | ||
``` | ||
@@ -102,0 +111,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
31983
797
144
0