#web-metadata
Retrieve a json object containing metadata from a url. Will return an object consisting of the <title>
, url
as well as any additional <meta/>
information it is able to parse.
Pull metadata from http://leap.it
javascript:
var metadata = require('web-metadata');
var opts = {
url: 'http://leap.it'
};
metadata(opts, function (err, data) {
// handle err or data here
console.log(data.url);
console.log(data.title);
console.log(data.contentType);
console.log(data.meta.description);
console.log(data.meta['twitter:site']);
});
output:
http://leap.it
Leap.it
text/html; charset=utf-8
Leap.it - a whole new take on search. What are you looking to discover? Try it now!
@leapit
With npm do:
npm install web-metadata
MIT