Sign Up for Free

RunKit +

Try any Node.js package right in your browser

This is a playground to test code. It runs a full Node.js environment and already has all of npm’s 1,000,000+ packages pre-installed, including metafetch with all npm packages installed. Try it out:

//import metafetch from 'metafetch'; // Runkit does not support import const metafetch = require("metafetch").default; metafetch.fetch('http://www.treehugger.com/those-falcon-wing-doors-are-coming-back-haunt-tesla-4858047').then(function(meta) { console.log('Title: ', meta.title); console.log('Description: ', meta.description); //console.log('Type: ', meta.type); console.log('URL: ', meta.url); console.log('AMPURL: ', meta.ampURL); //console.log('SiteName: ', meta.siteName); //console.log('Charset: ', meta.charset); console.log('Image: ', meta.image); //console.log('Meta: ', meta.meta); console.log('Images: ', meta.images); console.log('Links: ', meta.links); console.log('Headers: ', meta.headers); console.log('Language: ', meta.language); }).catch(console.error); /* Optional flags to disable parsing images and links and http timeout or headers metafetch.fetch('http://www.treehugger.com/those-falcon-wing-doors-are-coming-back-haunt-tesla-4858047', { flags: { images: false, links: false, headers: false, language: false }, http: { timeout: 30000 } }, function (err, meta) { if (err) { return console.error(err); } console.log('Title: ', meta.title); console.log('Description: ', meta.description); //console.log('Type: ', meta.type); console.log('URL: ', meta.url); console.log('AMPURL: ', meta.ampURL); //console.log('SiteName: ', meta.siteName); //console.log('Charset: ', meta.charset); console.log('Image: ', meta.image); //console.log('Meta: ', meta.meta); }); */

This service is provided by RunKit and is not affiliated with npm, Inc or the package authors.

metafetch v3.0.4

Metafetch fetches a given URL's title, description, images, links etc.

RunKit is a free, in-browser JavaScript dev environment for prototyping Node.js code, with every npm package installed. Sign up to share your code.
Sign Up for Free