Comparing version 0.4.6 to 0.4.8
var request = require('superagent'); | ||
var nodeBinaryParser = function (res, done) { | ||
res.text = ''; | ||
res.setEncoding('binary'); | ||
res.on('data', function (chunk) { | ||
res.text += chunk; | ||
}); | ||
res.on('end', function () { | ||
done(); | ||
}); | ||
}; | ||
var doGet = function (url, args, ret) { | ||
return new Promise(function (resolve, reject) { | ||
request | ||
var r = request | ||
.get(url) | ||
.query(args) | ||
.buffer(true) | ||
.end(function (err, res) { | ||
.buffer(true); | ||
if (ret === 'text') { | ||
r.parse(nodeBinaryParser); | ||
} | ||
r.end(function (err, res) { | ||
if (err) reject(err); | ||
@@ -11,0 +27,0 @@ resolve(ret === 'text' ? res.text : res.body); |
{ | ||
"name": "crex", | ||
"version": "0.4.6", | ||
"version": "0.4.8", | ||
"description": "Creative Exchange SDK for Javascript", | ||
@@ -5,0 +5,0 @@ "author": "Mateusz Luczak <mateusz.luczak@outlook.com>", |
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
17006
366