Socket
Socket
Sign inDemoInstall

fetch-opengraph

Package Overview
Dependencies
2
Maintainers
1
Versions
33
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 1.0.0 to 1.0.2

4

package.json
{
"name": "fetch-opengraph",
"version": "1.0.0",
"version": "1.0.2",
"description": ".fetch() to get opengraph information on a url",

@@ -31,3 +31,3 @@ "main": "index.js",

},
"license": "ISC",
"license": "MIT License",
"bugs": {

@@ -34,0 +34,0 @@ "url": "https://github.com/purphoros/fetch-opengraph/issues"

# fetch-opengraph
.fetch() to get opengraph information on a url
Fetch opengraph information from an url.
## Install
```
npm install fetch-opengraph --save
```
or
```
yarn add fetch-opengraph
```
## Usage
### Node example
Just a basic index.js running `node .`
```javascript
const fetchOpengraph = require('fetch-opengraph/lib');
(async () => {
const data = await fetchOpengraph.fetch('https://github.com/purphoros/fetch-opengraph');
console.log(data)
})()
```
Running in a web environment
```javascript
import fetchOpengraph from 'fetch-opengraph/lib';
(async () => {
const data = await fetchOpengraph.fetch('https://github.com/purphoros/fetch-opengraph');
console.log(data)
})()
```
### Expected result
```javascript
{
description: 'Fetch opengraph information from an url.',
'twitter:image:src': 'https://avatars.githubusercontent.com/u/4297636?s=400&v=4',
'twitter:card': 'summary',
'twitter:title': 'purphoros/fetch-opengraph',
'twitter:description': 'Fetch opengraph information from an url.',
'og:image': 'https://avatars.githubusercontent.com/u/4297636?s=400&v=4',
'og:type': 'object',
'og:title': 'purphoros/fetch-opengraph',
'og:url': 'https://github.com/purphoros/fetch-opengraph',
'og:description': 'Fetch opengraph information from an url.',
image: 'https://avatars.githubusercontent.com/u/4297636?s=400&v=4',
url: 'https://github.com/purphoros/fetch-opengraph'
}
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc