Socket
Socket
Sign inDemoInstall

then-request

Package Overview
Dependencies
Maintainers
1
Versions
27
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

then-request - npm Package Compare versions

Comparing version 1.0.4 to 1.0.5

12

package.json
{
"name": "then-request",
"version": "1.0.4",
"version": "1.0.5",
"description": "A request library that returns promises, inspired by request",

@@ -8,11 +8,11 @@ "keywords": [],

"dependencies": {
"promise": "^6.0.0",
"concat-stream": "^1.4.6",
"qs": "^2.2.3",
"promise": "^6.0.1",
"concat-stream": "^1.4.7",
"qs": "^2.3.3",
"http-response-object": "^1.0.1",
"http-basic": "^1.0.3"
"http-basic": "^1.1.1"
},
"devDependencies": {
"testit": "^1.2.0",
"istanbul": "^0.3.0"
"istanbul": "^0.3.5"
},

@@ -19,0 +19,0 @@ "scripts": {

@@ -5,2 +5,3 @@ 'use strict';

var test = require('testit');
var Promise = require('promise');

@@ -10,2 +11,4 @@ test('./lib/handle-qs.js', function () {

assert(handleQs('http://example.com/', {}) === 'http://example.com/');
assert(handleQs('http://example.com/?foo=bar', {}) === 'http://example.com/?foo=bar');
assert(handleQs('http://example.com/', {foo: 'bar'}) === 'http://example.com/?foo=bar');

@@ -72,4 +75,26 @@ assert(handleQs('http://example.com/', {foo: {bar: 'baz'}}) === 'http://example.com/?foo%5Bbar%5D=baz');

});
test(env + ' - Callbacks', function () {
return new Promise(function (resolve, reject) {
return request('GET', 'http://example.com', function (err, res) {
if (err) return reject(err);
assert(res.statusCode === 200);
assert(res.headers['foo'] === 'bar');
assert(res.body.toString() === 'body');
resolve(null);
});
});
});
test(env + ' - Callbacks', function () {
return new Promise(function (resolve, reject) {
return request('GET', 'http://example.com', {}, function (err, res) {
if (err) return reject(err);
assert(res.statusCode === 200);
assert(res.headers['foo'] === 'bar');
assert(res.body.toString() === 'body');
resolve(null);
});
});
});
}
testEnv('browser');
testEnv('server');
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