Use it to retrieve all metadata from a website.
Last update : follows redirects.
/ | |
---|---|
Issues open | |
Issues closed | |
Downloads | |
Bugs | |
Dependents | |
Install size | |
GitHub stars | |
TypeScript support |
Available in JS and TS, for both ESM and CJS.
// for ESM :
import { webscrap } from 'node-webscrap';
// for CJS :
const { webscrap } = require('node-webscrap');
const data = await webscrap('https://google.fr');
// result :
interface IWebsiteInfos {
metadata: {
title?: string;
description?: string;
themeColor?: string;
author?: string;
robots?: string;
favicons?: string[];
},
openGraph: {
// four basic og metatans
title?: string;
type?: string;
url?: string;
image?: string;
// optional og metatans
name?: string;
description?: string;
audio?: string;
determiner?: string;
locale?: string;
localAlternate?: string[];
video?: string;
// Facebook image specifications og:image:*
imageWidth?: number;
imageHeight?: number;
imageAlt?: string;
imageType?: string;
// video optional specifications
videoType?: string;
videoWidth?: number;
videoHeight?: number;
// audio optional specifications
audioType?: string;
},
social: {
twitter: {
card?: string;
title?: string;
description?: string;
site?: string;
image?: string;
creator?: string;
}
}
}
For fetching resources, it uses does not use any dependency. It uses the core http/https modules from NodeJS, so this package is lightweight.
Feel free to open issues and pull requests if you wants to improve this package.
Issues are answered in the day.
This package is under the MIT licence.