JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 861
  • Score
    100M100P100Q99533F
  • License MIT

Easily retrieve and parse a host's .well-known/host-meta file

Package Exports

  • hostmeta

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (hostmeta) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

getHostMeta

Fetch and parse .well-known/host-meta

Build Status Dependency Status devDependency Status

Browser Support

What is this?

A browser module for looking up metadata about a host, using the /.well-known/host-meta[.json] files, which is useful for discovering associated services for a host, such as an OpenID endpoint or where to connect for an XMPP BOSH/WebSocket session.

Installing

$ npm install hostmeta

Building bundled/minified version (for AMD, etc)

$ grunt

The bundled and minified files will be in the generated build directory.

How to use it

var getHostMeta = require('hostmeta');

getHostMeta('example.com', function (err, data) {
    if (err) {
        console.log("Couldn't retrieve host-meta data");
    }
    console.log(data);
    // Where data might look like:
    // {
    //   "links": [
    //     {
    //       "rel": "urn:xmpp:alt-connections:websocket",
    //       "href': "wss://example.com:5281/xmpp-websocket"
    //     },
    //     {
    //       "rel": "author",
    //       "href': "http://example.com/joe"
    //     }
    //   ]
    // }
});

License

MIT

Created By

If you like this, follow: @lancestout on twitter.