Comparing version 0.1.3 to 0.1.4
19
index.js
@@ -5,3 +5,4 @@ var defaults = { | ||
version: "latest", | ||
debug: false | ||
debug: false, | ||
timeout: null | ||
} | ||
@@ -13,2 +14,3 @@ | ||
, _debug = defaults.debug | ||
, _timeout = defaults.timeout | ||
, request = require('request') | ||
@@ -31,3 +33,4 @@ , Q = require('q'); | ||
method: verb, | ||
json:true | ||
json:true, | ||
timeout: _timeout, | ||
} | ||
@@ -42,3 +45,7 @@ if(verb==='post'){ | ||
request(options, function(err, response, body){ | ||
if(!err && response.statusCode == 200 && body.responseCode == 200){ | ||
if(err){ | ||
deferred.reject(err); | ||
return; | ||
} | ||
if(response.statusCode == 200 && body.responseCode == 200){ | ||
deferred.resolve(body.content); | ||
@@ -49,5 +56,2 @@ } | ||
} | ||
if(err){ | ||
deferred.reject(new Error("Error while request, reason unknown")); | ||
} | ||
}); | ||
@@ -64,3 +68,4 @@ } | ||
, _version = options.version || defaults.version | ||
, _debug = options.debug || defaults.debug; | ||
, _debug = options.debug || defaults.debug | ||
, _timeout = options.timeout || defaults.timeout; | ||
@@ -67,0 +72,0 @@ if(_debug){ |
@@ -0,0 +0,0 @@ var defaults = { |
@@ -10,3 +10,3 @@ { | ||
"description": "jotform API nodejs client", | ||
"version": "0.1.3", | ||
"version": "0.1.4", | ||
"directories": { | ||
@@ -13,0 +13,0 @@ "test": "test" |
@@ -7,3 +7,5 @@ jotform-api-nodejs | ||
npm install jotform | ||
```sh | ||
$ npm install jotform | ||
``` | ||
@@ -37,3 +39,3 @@ ### Documentation | ||
See [Documentation](http://api.jotform.com) for full list of methods available | ||
See [Documentation](http://api.jotform.com) for full list of methods available. | ||
@@ -0,0 +0,0 @@ var jf = require('JotForm'); |
@@ -0,0 +0,0 @@ var jf = require("../JotForm") |
Sorry, the diff of this file is not supported yet
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
10
1057
40
55838
1