Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

cordova-promise-fs

Package Overview
Dependencies
Maintainers
1
Versions
24
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

cordova-promise-fs - npm Package Compare versions

Comparing version 0.5.0 to 0.5.1

2

bower.json
{
"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 @@

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc