Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

restjs-api

Package Overview
Dependencies
Maintainers
1
Versions
13
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

restjs-api - npm Package Compare versions

Comparing version 0.1.2 to 0.1.3

23

index.js

@@ -100,13 +100,18 @@ var request = require("request");

// send request and wait for its response
request(optionsToUse, function(error, response) {
if (options.stream) {
if (options.stream) return cb(error, response);
// send request and pipe the response
cb(null, request(optionsToUse));
} else {
cb(error, response ? {
status: response.statusCode,
headers: response.headers,
body: tryParseBodyAsJson(response)
} : null );
});
// send request and wait for its response
request(optionsToUse, function(error, response) {
cb(error, response ? {
status: response.statusCode,
headers: response.headers,
body: tryParseBodyAsJson(response)
} : null );
});
}
};

@@ -113,0 +118,0 @@

{
"name": "restjs-api",
"version": "0.1.2",
"version": "0.1.3",
"description": "Kidozen's connector to invoke REST services",

@@ -5,0 +5,0 @@ "main": "index.js",

@@ -88,2 +88,3 @@ var assert = require('assert');

res.setHeader("x-foo", "bar");
res.setHeader("Content-Type", "text/baz");
res.statusCode = 201;

@@ -98,2 +99,3 @@ res.end();

assert.equal("bar", result.headers["x-foo"]);
assert.equal("text/baz", result.headers["content-type"]);
assert.equal(201, result.statusCode);

@@ -100,0 +102,0 @@ done();

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