Socket
Socket
Sign inDemoInstall

node-superfetch

Package Overview
Dependencies
Maintainers
1
Versions
25
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

node-superfetch - npm Package Compare versions

Comparing version 0.0.2 to 0.0.3

20

index.js

@@ -36,13 +36,15 @@ const fetch = require('node-fetch');

return raw.toString();
},
get body() {
if (/application\/json/gi.test(res.headers['content-type'])) {
try {
return JSON.parse(raw.toString());
} catch (err) {
return raw.toString();
}
} else {
return raw;
}
}
};
if (/application\/json/gi.test(res.headers['content-type'])) {
try {
res.body = JSON.parse(res.text);
} catch (err) {
res.body = res.text;
}
} else {
res.body = raw;
}
if (!response.ok) {

@@ -49,0 +51,0 @@ const err = new Error(`${res.status} ${res.statusText}`);

{
"name": "node-superfetch",
"version": "0.0.2",
"version": "0.0.3",
"description": "A wrapper for node-fetch that makes it appear like superagent.",

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

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