meta-fetcher
v3.1.1
Published
simple metadata scrapper for node.js
Downloads
2,678
Maintainers
Readme
meta-fetcher
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.