node-webscrap
TypeScript icon, indicating that this package has built-in type declarations

1.2.1 • Public • Published

node-webscrap

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

Usage

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.

Bug report and contribution

Feel free to open issues and pull requests if you wants to improve this package.

Issues are answered in the day.

Licence

This package is under the MIT licence.

Package Sidebar

Install

npm i node-webscrap

Weekly Downloads

9

Version

1.2.1

License

MIT

Unpacked Size

20.6 kB

Total Files

7

Last publish

Collaborators

  • noxfly