meta-fetcher
TypeScript icon, indicating that this package has built-in type declarations

3.1.1 • Public • Published

meta-fetcher

GitHub Workflow Status (branch) npm

Simple metadata scrapper for node.js. Under the hood it uses isomorphic-unfetch
to fetch the metadata, parses it and returns it as json object.


Installation

npm install meta-fetcher

or use yarn

yarn add meta-fetcher

Usage

import metaFetcher from 'meta-fetcher';

(async () => {
  const result = await metaFetcher('https://hoppscotch.io/');
  console.log(result);

  /*
        {
            metadata: {
                website: 'https://hoppscotch.io/',
                title: 'Hoppscotch - Open source API development ecosystem',
                description: 'Helps you create requests faster, saving precious time on development.',
                banner: 'https://hoppscotch.io/banner.jpg',
                themeColor: '#202124'
            },
            socials: {
                'twitter:site': '@hoppscotch_io',
                'twitter:creator': '@hoppscotch_io'
            },
            favicons: [
                'https://hoppscotch.io/_nuxt/icons/icon_64x64.9834b3.png',
                'https://hoppscotch.io/_nuxt/icons/icon_512x512.9834b3.png'
            ]
        }
    */
})();

API

metaFetcher(input)

Takes one url string as a parameter and returns an object containing the meta-information.

input

type: string
default: 'none'

The url string to be scrapped.


Related

Here are some related projects

  • page-scrapper: 📦 node.js scrapper that pulls out all links and images of a given site.

License

MIT

Dependents (0)

Package Sidebar

Install

npm i meta-fetcher

Weekly Downloads

278

Version

3.1.1

License

MIT

Unpacked Size

13.6 kB

Total Files

10

Last publish

Collaborators

  • rocktimsaikia