Socket
Socket
Sign inDemoInstall

crypto-news-api

Package Overview
Dependencies
Maintainers
1
Versions
19
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

crypto-news-api - npm Package Compare versions

Comparing version 1.0.1 to 1.0.2

18

dist/index.js

@@ -60,12 +60,10 @@ "use strict";

if (query === void 0) { query = {}; }
return __awaiter(this, void 0, void 0, function () {
var queryString;
return __generator(this, function (_a) {
switch (_a.label) {
case 0:
queryString = qs.stringify(__assign({}, query, { key: this.apikey }));
return [4 /*yield*/, node_fetch_1.default("" + API_HOST + url + "?" + queryString)];
case 1: return [2 /*return*/, _a.sent()];
}
});
var queryString = qs.stringify(__assign({}, query, { key: this.apikey }));
return node_fetch_1.default("" + API_HOST + url + "?" + queryString)
.then(function (response) {
if (response.status === 401)
throw new Error('Invalid API Key');
if (response.status !== 200)
throw new Error('Bad response from the CryptoControl server');
return response.json();
});

@@ -72,0 +70,0 @@ };

@@ -55,3 +55,3 @@ import fetch from 'node-fetch'

private async _fetch(url: string, query: any = {}): Promise<any> {
private _fetch(url: string, query: any = {}): Promise<any> {
const queryString = qs.stringify({

@@ -62,3 +62,9 @@ ...query,

return await fetch(`${API_HOST}${url}?${queryString}`)
return fetch(`${API_HOST}${url}?${queryString}`)
.then(response => {
if (response.status === 401) throw new Error('Invalid API Key')
if (response.status !== 200) throw new Error('Bad response from the CryptoControl server')
return response.json()
})
}

@@ -65,0 +71,0 @@

{
"name": "crypto-news-api",
"version": "1.0.1",
"version": "1.0.2",
"description": "API to get a crypto newsfeed in your app",

@@ -5,0 +5,0 @@ "main": "dist/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