Skip to content

Latest commit

 

History

History
38 lines (32 loc) · 853 Bytes

README.md

File metadata and controls

38 lines (32 loc) · 853 Bytes

#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.

Example

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

Install

With npm do:

npm install web-metadata

License

MIT