
Security News
NIST Under Federal Audit for NVD Processing Backlog and Delays
As vulnerability data bottlenecks grow, the federal government is formally investigating NIST’s handling of the National Vulnerability Database.
metadata-fetch
Advanced tools
This package is used to fetch the metadata of given url or site with help of cheerio.
This Node.js module fetches and extracts metadata from a given URL using Cheerio. The extracted metadata includes Open Graph tags, keywords, and the canonical URL.
npm i metadata-fetch
import { getMetadata } from 'metadata-fetch';
// Example URL
const url = 'https://example.com';
const getData = async() => await getMetadata(url).then(metadata => {
console.log(metadata);
});
getData()
//getMetadata(url: string)
Fetches the metadata from the provided URL.
{
"title": "Open Graph title",
"description": "Open Graph description",
"image": "Open Graph image URL",
"url": "Open Graph URL",
"keywords": "Page keywords",
"canonical": "Canonical URL"
}
{
"error": "Error message"
}
The getMetadata function handles errors gracefully and returns an error message in the following cases:
If the URL is not provided.
If the URL is not valid.
If the fetch request fails.
If an error occurs during the extraction of metadata.
This package is made using cheerio❤️.
FAQs
This package is used to fetch the metadata of given url or site with help of cheerio.
The npm package metadata-fetch receives a total of 7 weekly downloads. As such, metadata-fetch popularity was classified as not popular.
We found that metadata-fetch demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
As vulnerability data bottlenecks grow, the federal government is formally investigating NIST’s handling of the National Vulnerability Database.
Research
Security News
Socket’s Threat Research Team has uncovered 60 npm packages using post-install scripts to silently exfiltrate hostnames, IP addresses, DNS servers, and user directories to a Discord-controlled endpoint.
Security News
TypeScript Native Previews offers a 10x faster Go-based compiler, now available on npm for public testing with early editor and language support.