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:

var metafetch = require('metafetch'); metafetch.fetch('http://www.treehugger.com/cars/tesla-model-x-update-first-ev-towing-capability-dual-motors-falcon-wing-doors-etc.html', 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); console.log('Images: ', meta.images); console.log('Links: ', meta.links); console.log('Headers: ', meta.headers); console.log('Language: ', meta.language); }); //Or using Promise metafetch.fetch('http://www.treehugger.com/cars/tesla-model-x-update-first-ev-towing-capability-dual-motors-falcon-wing-doors-etc.html').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/cars/tesla-model-x-update-first-ev-towing-capability-dual-motors-falcon-wing-doors-etc.html', { 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 v1.9.3

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