Socket
Socket
Sign inDemoInstall

fetch-opengraph

Package Overview
Dependencies
Maintainers
1
Versions
33
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

fetch-opengraph - npm Package Compare versions

Comparing version 1.0.22 to 1.0.23

4

index.d.ts

@@ -16,6 +16,6 @@ export declare const metaTags: {

};
export declare const fetch: (url: string) => Promise<any>;
export declare const fetch: (url: string, headers?: any) => Promise<any>;
declare const _default: {
fetch: (url: string) => Promise<any>;
fetch: (url: string, headers?: any) => Promise<any>;
};
export default _default;

@@ -29,3 +29,3 @@ "use strict";

};
const fetch = (url) => __awaiter(void 0, void 0, void 0, function* () {
const fetch = (url, headers) => __awaiter(void 0, void 0, void 0, function* () {
const { title, description, ogUrl, ogType, ogTitle, ogDescription, ogImage, twitterCard, twitterDomain, twitterUrl, twitterTitle, twitterDescription, twitterImage } = exports.metaTags;

@@ -35,7 +35,3 @@ return new Promise((resolve, reject) => __awaiter(void 0, void 0, void 0, function* () {

const response = yield axios_1.default.get(url, {
headers: {
'Cache-Control': 'no-cache',
Accept: '*/*',
Connection: 'keep-alive'
}
headers: Object.assign({ 'User-Agent': 'OpenGraph', 'Cache-Control': 'no-cache', Accept: '*/*', Connection: 'keep-alive' }, headers)
});

@@ -124,17 +120,3 @@ if (response.status >= 400) {

catch (error) {
return resolve({
'title': '',
'description': '',
'og:url': url,
'og:type': '',
'og:title': '',
'og:description': '',
'og:image': '',
'twitter:card': '',
'twitter:domain': '',
'twitter:url': url,
'twitter:title': '',
'twitter:description': '',
'twitter:image': '',
});
return reject(error);
}

@@ -141,0 +123,0 @@ }));

{
"name": "fetch-opengraph",
"version": "1.0.22",
"version": "1.0.23",
"description": "Fetch opengraph information from an url",

@@ -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