Gathering detailed insights and metrics for link-meta-extractor
Gathering detailed insights and metrics for link-meta-extractor
Link Meta Extractor. Extract Metadata from url. Pass a url string and get all the available metadata in object.
npm install link-meta-extractor
Typescript
Module System
Node Version
NPM Version
64
Supply Chain
95.6
Quality
76.5
Maintenance
100
Vulnerability
99.6
License
TypeScript (83.67%)
JavaScript (16.33%)
Total Downloads
6,811
Last Day
44
Last Week
156
Last Month
573
Last Year
3,693
6 Stars
34 Commits
1 Forks
2 Watching
1 Branches
1 Contributors
Latest Version
1.3.7
Package Id
link-meta-extractor@1.3.7
Unpacked Size
17.81 kB
Size
4.98 kB
File Count
16
NPM Version
9.8.1
Node Version
18.18.0
Publised On
25 May 2024
Cumulative downloads
Total Downloads
Last day
-8.3%
44
Compared to previous day
Last week
-23.5%
156
Compared to previous week
Last month
67.1%
573
Compared to previous month
Last year
63.1%
3,693
Compared to previous year
Extract metadata information from any http/https url. Simply pass a url string to the function and wait for the metadata results. You can run the code with async/await or use a callback to get results.
1npm install link-meta-extractor
If you want to extract metadata information from a website using async/await then go with following code...
1import { extractMetadata } from 'link-meta-extractor'; 2 3async function extractMeta() { 4 const url = 'https://stackblogger.com'; 5 const metaInformation = await extractMetadata(url); 6 7 console.log(metaInformation); 8} 9 10extractMeta(); 11 12/* 13 { 14 title: 'StackBlogger - A blog by programmer for programmers', 15 description: 'StackBlogger provide programming Tutorials, Tips, Tricks and HowTo Guides.', 16 banner: 'https://stackblogger.com/wp-content/uploads/2021/10/Untitled-7-1.png', 17 isItWordpress: true, 18 wordpressVersion: 'WordPress 5.8.1' 19 } 20*/
If you want to extract metadata information from a website using callback method then go with following code...
1import { extractMetadata } from 'link-meta-extractor'; 2 3function extractMeta() { 4 const url = 'https://stackblogger.com'; 5 extractMetadata(url).then((metaInformation) => { 6 console.log(metaInformation); 7 }); 8} 9 10extractMeta(); 11 12/* 13 { 14 title: 'StackBlogger - A blog by programmer for programmers', 15 description: 'StackBlogger provide programming Tutorials, Tips, Tricks and HowTo Guides.', 16 banner: 'https://stackblogger.com/wp-content/uploads/2021/10/Untitled-7-1.png', 17 isItWordpress: true, 18 wordpressVersion: 'WordPress 5.8.1' 19 } 20*/
Use the following code to extract metadata information from an url in JavaScript code
If you want to extract metadata information from a website using async/await then go with following code...
1const metaExtractor = require('link-meta-extractor'); 2 3async function extractMeta() { 4 const url = 'https://stackblogger.com'; 5 const metaInformation = await metaExtractor.extractMetadata(url); 6 console.log(metaInformation); 7} 8 9extractMeta(); 10 11/* 12 { 13 title: 'StackBlogger - A blog by programmer for programmers', 14 description: 'StackBlogger provide programming Tutorials, Tips, Tricks and HowTo Guides.', 15 banner: 'https://stackblogger.com/wp-content/uploads/2021/10/Untitled-7-1.png', 16 isItWordpress: true, 17 wordpressVersion: 'WordPress 5.8.1' 18 } 19*/
If you want to extract metadata information from a website using callback method then go with following code...
1const metaExtractor = require('link-meta-extractor'); 2 3function extractMeta() { 4 const url = 'https://stackblogger.com'; 5 metaExtractor.extractMetadata(url).then((metaInformation) => { 6 console.log(metaInformation); 7 }); 8} 9 10extractMeta(); 11 12/* 13 { 14 title: 'StackBlogger - A blog by programmer for programmers', 15 description: 'StackBlogger provide programming Tutorials, Tips, Tricks and HowTo Guides.', 16 banner: 'https://stackblogger.com/wp-content/uploads/2021/10/Untitled-7-1.png', 17 isItWordpress: true, 18 wordpressVersion: 'WordPress 5.8.1' 19 } 20*/
The plugin accepts additional fields as optional argument that you can use to extract from a website.
Pass the meta field keys in string format as a rest parameter in function. Refer the code here...
1import { extractMetadata } from 'link-meta-extractor'; 2 3async function extractMeta() { 4 const url = 'https://stackblogger.com'; 5 const metaInformation = await extractMetadata( 6 url, 7 'og:site_name', // additional field 8 'og:image', // additional field 9 'robots' // additional field 10 ); 11 12 console.log(metaInformation); 13} 14 15extractMeta(); 16 17/* 18 { 19 title: 'StackBlogger - A blog by programmer for programmers', 20 description: 'StackBlogger provide programming Tutorials, Tips, Tricks and HowTo Guides.', 21 banner: 'https://stackblogger.com/wp-content/uploads/2021/10/Untitled-7-1.png', 22 isItWordpress: true, 23 wordpressVersion: 'WordPress 5.8.1', 24 additional: { 25 siteName: 'StackBlogger', 26 image: 'https://stackblogger.com/wp-content/uploads/2021/10/Untitled-7-1.png', 27 robots: 'index, follow, max-image-preview:large, max-snippet:-1, max-video-preview:-1' 28 } 29 } 30*/
No vulnerabilities found.
No security vulnerabilities found.