Comparing version 0.1.4 to 0.1.5
@@ -19,16 +19,11 @@ var request = require('request') | ||
Request.prototype.watch = function(url, message, exit) | ||
Request.prototype.watch = function(url, message, exit, timeout) | ||
{ | ||
var jsonstr = '' | ||
request.get(this.domain + url, function(){}).on('data', function(data) | ||
request.get(this.domain + url, {timeout: timeout},function(){}).on('data', function(data) | ||
{ | ||
var json | ||
try{ | ||
jsonstr += data.toString() | ||
json = JSON.parse(jsonstr) | ||
jsonstr = '' | ||
}catch(e){} | ||
json = JSON.parse(data.toString()) | ||
}catch(e){ | ||
} | ||
if( json ) | ||
@@ -38,2 +33,4 @@ message(json) | ||
exit && exit(err) | ||
}).on('response', function(response){ | ||
}) | ||
@@ -43,2 +40,3 @@ } | ||
Request.prototype.post = function(url, body, done){ | ||
// console.log(url, body) | ||
request.post({ url: this.domain + url, json: body }, function(err, res, data){ | ||
@@ -50,2 +48,3 @@ done(err, data) | ||
Request.prototype.put = function(url, body, done){ | ||
// console.log(url, body) | ||
request.put({ url: this.domain + url, json: body }, function(err, res, data){ | ||
@@ -52,0 +51,0 @@ done(err, data) |
{ | ||
"name": "k8s", | ||
"version": "0.1.4", | ||
"version": "0.1.5", | ||
"description": "", | ||
@@ -5,0 +5,0 @@ "repository": { |
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
111300
2619