Gathering detailed insights and metrics for open-graph-scraper-lite
Gathering detailed insights and metrics for open-graph-scraper-lite
npm install open-graph-scraper-lite
Typescript
Module System
Min. Node Version
Node Version
NPM Version
74.2
Supply Chain
92.6
Quality
76
Maintenance
100
Vulnerability
100
License
TypeScript (100%)
Total Downloads
49,136
Last Day
42
Last Week
685
Last Month
4,205
Last Year
35,866
26 Stars
28 Commits
8 Forks
2 Watching
1 Branches
2 Contributors
Minified
Minified + Gzipped
Latest Version
2.1.0
Package Id
open-graph-scraper-lite@2.1.0
Unpacked Size
124.86 kB
Size
15.16 kB
File Count
29
NPM Version
9.8.1
Node Version
18.18.0
Publised On
15 Jul 2024
Cumulative downloads
Total Downloads
Last day
2.4%
42
Compared to previous day
Last week
10.7%
685
Compared to previous week
Last month
-6.1%
4,205
Compared to previous month
Last year
2,073.7%
35,866
Compared to previous year
A simple javascript module for scraping Open Graph and Twitter Card info from given HTML. For Node.js usage, we recommend open-graph-scraper
by the same people and can do HTTP requests.
1npm install open-graph-scraper-lite --save
1const ogs = require('open-graph-scraper'); 2const options = { 3 html: `<html><head> 4 <link rel="icon" type="image/png" href="https://bar.com/foo.png" /> 5 <meta charset="utf-8" /> 6 <meta property="og:description" name="og:description" content="html description example" /> 7 <meta property="og:image" name="og:image" content="https://www.foo.com/bar.jpg" /> 8 <meta property="og:title" name="og:title" content="foobar" /> 9 <meta property="og:type" name="og:type" content="website" /> 10 </head></html>` 11}; 12ogs(options) 13 .then((data) => { 14 const { result } = data; 15 console.log('result:', result); 16 })
1result: { 2 ogDescription: 'html description example', 3 ogTitle: 'foobar', 4 ogType: 'website', 5 ogImage: [ { url: 'https://www.foo.com/bar.jpg', type: 'jpg' } ], 6 favicon: 'https://bar.com/foo.png', 7 charset: 'utf-8', 8 success: true 9}
Name | Info | Default Value | Required |
---|---|---|---|
html | You can pass in an HTML string to run ogs on it. (use without options.url) | x | |
onlyGetOpenGraphInfo | Only fetch open graph info and don't fall back on anything else. | false | |
customMetaTags | Here you can define custom meta tags you want to scrape. | [] |
1const ogs = require('open-graph-scraper'); 2const options = { 3 html: `<html><head> 4 <link rel="icon" type="image/png" href="https://bar.com/foo.png" /> 5 <meta charset="utf-8" /> 6 <meta property="og:description" name="og:description" content="html description example" /> 7 <meta property="og:image" name="og:image" content="https://www.foo.com/bar.jpg" /> 8 <meta property="og:title" name="og:title" content="foobar" /> 9 <meta property="og:type" name="og:type" content="website" /> 10 <meta name="hostname" content="github.com"> 11 </head></html>`, 12 customMetaTags: [{ 13 multiple: false, // is there more than one of these tags on a page (normally this is false) 14 property: 'hostname', // meta tag name/property attribute 15 fieldName: 'hostnameMetaTag', // name of the result variable 16 }], 17}; 18ogs(options) 19 .then((data) => { 20 const { result } = data; 21 console.log('hostnameMetaTag:', result.customMetaTags.hostnameMetaTag); // hostnameMetaTag: github.com 22 })
No vulnerabilities found.
Reason
no dangerous workflow patterns detected
Reason
no binaries found in the repo
Reason
license file detected
Details
Reason
3 existing vulnerabilities detected
Details
Reason
Found 1/11 approved changesets -- score normalized to 0
Reason
detected GitHub workflow tokens with excessive permissions
Details
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
dependency not pinned by hash detected -- score normalized to 0
Details
Reason
security policy file not detected
Details
Reason
project is not fuzzed
Details
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
Score
Last Scanned on 2025-01-06
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More