couchdb_utilities
Advanced tools
Comparing version 1.0.11-prerelease to 1.0.12-prerelease
35
index.js
@@ -157,24 +157,29 @@ exports.printMsg = function() { | ||
exports.callURL = function ( Method, URL, Payload ) { | ||
exports.callURL = function ( Method, URL, Payload, headers ) { | ||
var returnObj = {} | ||
var syncRequest = require('sync-request'); | ||
var jsonPayload = { | ||
json: JSON.parse( Payload ) | ||
}; | ||
var returnObj = {} | ||
var syncRequest = require('sync-request'); | ||
if ( ! headers ) { | ||
var headers = { "Content-Type": "application/json" }; | ||
} | ||
var jsonPayload = { | ||
headers: headers, | ||
body: Payload | ||
}; | ||
returnObj.startTime = (new Date).getTime(); | ||
var response = syncRequest(Method, URL, jsonPayload ); | ||
returnObj.endTime = (new Date).getTime(); | ||
returnObj.startTime = (new Date).getTime(); | ||
var response = syncRequest(Method, URL, jsonPayload ); | ||
returnObj.endTime = (new Date).getTime(); | ||
returnObj.duration = returnObj.endTime - returnObj.startTime; | ||
returnObj.duration = returnObj.duration + " milliseconds" | ||
returnObj.duration = returnObj.endTime - returnObj.startTime; | ||
returnObj.duration = returnObj.duration + " milliseconds" | ||
var responseString = response.body.toString('utf8'); | ||
var responseString = response.body.toString('utf8'); | ||
returnObj.responseCode = response.statusCode; | ||
returnObj.responseString = responseString; | ||
returnObj.responseCode = response.statusCode; | ||
returnObj.responseString = responseString; | ||
return returnObj; | ||
return returnObj; | ||
}; |
{ | ||
"name": "couchdb_utilities", | ||
"version": "v1.0.11prerelease", | ||
"version": "v1.0.12prerelease", | ||
"description": "This package contains utilties to use and support couchdb environments.", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
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
Manifest confusion
Supply chain riskThis package has inconsistent metadata. This could be malicious or caused by an error when publishing the package.
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
Manifest confusion
Supply chain riskThis package has inconsistent metadata. This could be malicious or caused by an error when publishing the package.
Found 1 instance in 1 package
7924
144